Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC:Script Based Calculated Value Set Timesatmp with now()

CLM 6.0.3 ifix5

I'm trying to set an timestamp attribute on save, which should get the date now.
1str try to ensure that it worked was to read from one attribute and writing in another:

dojo.provide("com.siemens.bt.workitems.providers.d1date");
dojo.require("dojo.date");
dojo.require("dojo.date.stamp"); dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

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

dojo.declare("com.siemens.bt.workitems.providers.d1date", null, {
        getValue: function(attribute, workItem, configuration) {

          var mDate = workItem.getValue("com.siemens.bt.workitem.attributes.d3date");
          return mDate;   
 }});})();
This worked as expected :-)

2.try
                var today = new Date();
                var todayStr = dojo.date.stamp.toISOString(today, {milliseconds:true, zulu:true});
                result= todayStr;

3.try
                var datevar = workItem.getValue(WorkItemAttributes.MODIFIED);
                result= datevar ;
4.try 
                result="2017-06-26T13:50:07+00:00"

I do not find any way to write the actual date during save. And BTW I was not able to debug. Nor with debug=true nor console.log

Any help would be very welcome

0 votes



One answer

Permanent link

No clue what I did yesterday...but today I got it :-)

dojo.provide("com.siemens.bt.workitems.providers.d1date");
dojo.require("dojo.date");
dojo.require("dojo.date.stamp");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

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

dojo.declare("com.siemens.bt.workitems.providers.d1date", null, {
getValue: function(attribute, workItem, configuration) {
     var today = new Date();
     var sDate = dojo.date.stamp.toISOString(today, {milliseconds:true, zulu:true});
return sDate;
     }
});
})();

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,016

Question asked: Jun 26 '17, 11:26 a.m.

Question was seen: 3,581 times

Last updated: Jun 27 '17, 8:18 a.m.

Confirmation Cancel Confirm