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");This worked as expected :-)
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;
}});})();
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
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;
}
});
})();