It's all about the answers!

Ask a question

Calculated value to work only in particular state


Uma venkata Lekkala (52819) | asked Jul 13 '15, 12:04 p.m.
edited Jul 13 '15, 12:18 p.m.
I have the below script that successfully updated Planned for iteration. Now for any other state the iteration is not allowed for manual update to any other value. What is wrong? How can I tell the script to leave the Planned for for regular manual updates in all other states?


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) {
             
             /* console.log(workItem.getValue(WorkItemAttributes.STATE));  */  
                        
               var state= workItem.getValue(WorkItemAttributes.STATE);
        console.log(typeof(state))
                    
             if(state === "com.ibm.team.workitem.taskWorkflow.state.s4")
                  {    return "_kCgEYQ-_EeWZJcN1wzIszA";   } 
                                            
             }
         });
     })();












One answer



permanent link
Uma venkata Lekkala (52819) | answered Jul 13 '15, 1:59 p.m.
edited Jul 13 '15, 1:59 p.m.
Resolved!
I needed to close the if loop with - 
else return WorkItemAttributes;




Your answer


Register or 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.