Set Planned_For iteration to specific value in a given SATE ID
How can my code be improved? I want to update the planned for to "Recycle Bin" Iteration value based on state id.
dojo.provide("ibm.custom.script.IterationByStatus");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("ibm.custom.script.IterationByStatus", null, {
getValue: function(attribute, workItem, configuration) {
var state= workItem.getValue(WorkItemAttributes.STATE);
console.log(typeof(state))
if (state === "com.ibm.team.workitem.taskWorkflow.state.s4") Or
(state === "com.ibm.team.workitem.retrospectiveWorkflow.state.s1") Or
(state == "com.ibm.team.apt.storyWorkflow.state.s4")
{ workItem.setValue(WorkItemAttributes.PLANNED_FOR, "Recycle Bin"); }
return
}
});
})();
dojo.provide("ibm.custom.script.IterationByStatus");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("ibm.custom.script.IterationByStatus", null, {
getValue: function(attribute, workItem, configuration) {
var state= workItem.getValue(WorkItemAttributes.STATE);
console.log(typeof(state))
if (state === "com.ibm.team.workitem.taskWorkflow.state.s4") Or
(state === "com.ibm.team.workitem.retrospectiveWorkflow.state.s1") Or
(state == "com.ibm.team.apt.storyWorkflow.state.s4")
{ workItem.setValue(WorkItemAttributes.PLANNED_FOR, "Recycle Bin"); }
return
}
});
})();
Accepted answer
I think you have already resolve this question based on this post.
Please let us know if you have any questions.