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

how can I use Script-based calculated values to reset timestamp column in empty?

in the beginning , the column has value (ex: 2014/6/30 PM 7:31:25)
when state == s4 , I want to  reset timestamp column in empty? But it dosen't work

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

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

    getValue: function(attributeId, workItem, configuration) {
var state= workItem.getValue(WorkItemAttributes.STATE);
if (state == "workflow.jobassign.state.s5") {
var date = new Date();
var sysdate= dojo.date.stamp.toISOString(date, {milliseconds:true, zulu:true});
return sysdate;
}else if (state == "workflow.jobassign.state.s4") {
console.log("state == s4");
return null;           //want to clear the column
}
return null;
    }
});
})();

0 votes

Comments

Can you describe a little bit better, what you try to do?
You can try to return something other than null e.g. "". Not sure if that works with timestamp attributes.

If the attribute is showing empty, what is the content you get with a script? Can you use that and return it?

 If the attribute is showing empty, the content you get with a script is null


I already tried return "" ,null and undefined  but the value still unchange !

Null is the right choice. I have no problems with setting a Timestamp field to "none". I suspect your code may fail in the middle, or may not even triggered. I suggest you start with the simplest function with the code "return null;" only.


Be the first one to answer this question!

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,019

Question asked: Jun 30 '14, 7:46 a.m.

Question was seen: 3,195 times

Last updated: Jul 04 '14, 12:06 a.m.

Confirmation Cancel Confirm