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

Field dependent values for the multi-select field in RTC 4.0

Hi,

Since it is not possible to set field dependent values for the multi-select field in RTC 4.0, I am trying to write a script based value set. This values set will provide list of values based on the FIELD_AGAINST field. But so far I am unable to achieve this using the java script that I wrote. I would appreciate if anyone can share the basic java script structure(code), that can read and compare the value of FILED_AGAINST field.

Thanks for your help in advance!
Rama

0 votes



2 answers

Permanent link
Take a look at this post to see if it helps:

https://jazz.net/forum/questions/92153/how-can-a-script-based-calculated-value-read-the-filed-against-aka-categories-field

0 votes

Comments

Thanks Brian,

I did not try xmlhttp, but was hoping simple API call will get me the value that I can compare with a string. But so far no luck.

value = workItem.getValue(WorkItemAttributes.FILED_AGAINST)

Thanks!
Rama


Permanent link
I will go ahead and answer my own question. After little bit of research, I found out that, workItem.getLabel will get the value of the field. To read the value for FILED_AGAINST field, following statement can be used in Java Script. Once you have the FILED_AGAINST value, you can return different value set for the other field based on the the value read.

           var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
           var category = workItem.getLabel(WorkItemAttributes.FILED_AGAINST);
if (category == "something"){
    result = Something
}else{
   result = Something else
}
           return result;

However,  looks like this approach will only work in Eclipse UI. I am unable to get it working in Web UI. As whenever I change the value of FILED_AGAINST field, it does not change the value of the other filed I am trying to recalculate. Looks like the script based value set does not get triggered on value change in Web UI. It is only triggered, the first time work item is loaded in the browser.

Thanks!
Rama

Thanks!
Rama

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
× 10,937

Question asked: Dec 18 '12, 2:19 p.m.

Question was seen: 4,814 times

Last updated: Mar 11 '13, 12:50 p.m.

Confirmation Cancel Confirm