Problem using configuration.getWorkflowAction for attribute customization
Moti Wertheimer (189●1●36●28)
| asked Dec 27 '12, 4:32 a.m.
JAZZ DEVELOPER edited Apr 02 '13, 4:44 a.m. by Ralph Schoon (63.4k●3●36●46)
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
Ralph Schoon (63.4k●3●36●46)
| answered Dec 29 '12, 6:04 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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/ .
Moti Wertheimer selected this answer as the correct answer
|
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.