It's all about the answers!

Ask a question

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


Erwin Kunz (94686181) | asked Jun 26 '17, 11:26 a.m.
edited Jun 26 '17, 11:28 a.m.

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

One answer



permanent link
Erwin Kunz (94686181) | answered Jun 27 '17, 8:17 a.m.
edited Jun 27 '17, 8:18 a.m.

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;
     }
});
})();

Your answer


Register or to post your answer.