Problem using configuration.getWorkflowAction for attribute customization
Hi,
I have created new custom timestamp attribute named "Reopened Date" and I want to use it like "Resoled date".
I have succeded to use a script based calculated value for state=reopened, but this is not accurate, I would like to catch the workflow action of reopen. but it is not working.
Here is my script:
dojo.provide("com.example.ValueProvider");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.example.ValueProvider", null, {
getValue: function(attribute, workItem, configuration) {
var currentDate= new Date();
//if (configuration.getWorkflowAction()=="bugzillaWorkflow.action.reopen") NOT WORKING...
if (workItem.getValue(WorkItemAttributes.STATE)=="6") {
return currentDate.getTime().toString();
}
return 0;
}
});
})();
Accepted answer
This has been discussed in the forum many times. Please search for answers in the last two days for more details. All you can do in a script is trigger on the value of the state. You can't see the previous value. Scripting is not a good approach for what you are trying. Try this approach http://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ .