It's all about the answers!

Ask a question

how to show date value attribute in any custom attribute of type string using script?


shweta ranaware (371751) | asked Aug 05 '15, 7:42 a.m.
edited Aug 05 '15, 8:17 a.m. by Ralph Schoon (63.1k33645)
 Hi,
  I want to show the date value of type time stamp in any of the custom attribute using script based value.
i also refer the  https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript this Link for that. but i am getting expected results in string. this is my script code for fetching the current date

dojo.provide("org.example.workitems.providers.DateFun");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.date");
dojo.require("dojo.date.stamp");

(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;

dojo.declare("org.example.workitems.providers.DateFun ", null, {

    getValue: function(attributeId, workItem, configuration) {

       
      var due_date= dojo.date.stamp.fromISOString(workItem.getValue(WorkItemAttributes.DUE_DATE));
    
           return due_date;
    }
});
})();
 Please guide is this correct way to access. 


One answer



permanent link
Tiago Moura (8387) | answered Aug 05 '15, 11:33 a.m.
edited Aug 05 '15, 11:33 a.m.
 I didn't follow your code line by line... but your reference is a good one and I already implemented successful scripts using such reference. So, I think it is the correct way to access.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.