Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Calculated value to work only in particular state

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";   } 
                                            
             }
         });
     })();












0 votes



One answer

Permanent link
Resolved!
I needed to close the if loop with - 
else return WorkItemAttributes;




0 votes

Your answer

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,131

Question asked: Jul 13 '15, 12:04 p.m.

Question was seen: 2,505 times

Last updated: Jul 13 '15, 1:59 p.m.

Related questions
Confirmation Cancel Confirm