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

Script conditions and parameters

I have a work item that has 5 field-groups which consist of a yes/no attribute and a text field.  If "yes" is selected, I need to have the text field required.

I can do this via a script-based condition, which i have wrote and tested for one of them.  My question is: can I use the same script for all 5 of these? I can define my condition with the script and then in the process configuration source, can update to add a <parameters> tag to indicate which yes/no field to check.  However, I basically have to hard-code it for the script in general, instead of being able to specify which yes/no attribute to check when I set the script-based condition in the Operational Behaviors section.

Can this be done (did I explain it okay)? 
If not, would the best way to do this be:
1) creating 5 copies of the java-script, hardcoding the attribute IDs to check
2) create 1 copy of the javascript, but 5 different Conditions using the same Local File Path but a different Attachment Path (can I even do this?)

Thanks
Susan

0 votes



One answer

Permanent link
Hi Susan,

I gave it a quick look. The issue is, as far as I can tell, that the condition runs in a precondition and you don't seem to have an indicator which attribute it is running for. Apparently the idea is, the condition checks whatever needs checking and returns yes or no. all attributes that have this condition configured get that value.

Since you, as far as I can see, don't know which work item attribute the condition runs for, I think you would have to create 5 copies. In 4.0.3 and higher, the UI will detect if you try to use the same attachment path, so I think you will have to maintain 5 copies. I am not sure if this would be any easier with a Java extension.

0 votes

Comments

Thanks for the confirmation .. .i didn't see anything so I thought I would ask.  I'll go ahead and get 5 copies ready and go that way.  The scripts are really short and easy, so I don't anticipate having to make many changes to them.

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,130
× 382

Question asked: Oct 22 '13, 6:43 a.m.

Question was seen: 5,204 times

Last updated: Oct 22 '13, 8:06 a.m.

Confirmation Cancel Confirm