It's all about the answers!

Ask a question

[closed] 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.
closed Aug 05 '15, 8:15 a.m. by Ralph Schoon (63.1k33646)
 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. 


The question has been closed for the following reason: "Duplicate Question" by rschoon Aug 05 '15, 8:15 a.m.