It's all about the answers!

Ask a question

Problem using configuration.getWorkflowAction for attribute customization


Moti Wertheimer (16913627) | asked Dec 27 '12, 4:32 a.m.
JAZZ DEVELOPER
edited Apr 02 '13, 4:44 a.m. by Ralph Schoon (55.5k23642)
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


permanent link
Ralph Schoon (55.5k23642) | 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


Register or to post your answer.