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

Java/Dojo script to change the attribute name depending on other attribute.

I have the below scenario for which I need to write java or dojo script. 
On a work item there are two tab A and B. There is a multi select attribute on Tab A. On tab B I have 50 attribute of type medium string. when selected multiple values on tab A, The attribute name/label should change to the names that are selected on tab A. example. if a select values as Red, Green, Organ, Blue (Multi select) on tab A. On tab B text box should be --->  Red [ ] Green[ ] Organ[ ] Blue[ ] . 

I am trying to write the script. But confused it should be applied for calculated values or value set, more over is it feasible to do so. Below is the bit of script which I am unable to complete. Can anyone of you help me to complete or share your script.  

dojo.provide("org.fca.workitems.providers.Get_Colour");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.string");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("org.fca.workitems.providers.ShowSWComponent", null, {
    getValueSet: function(attributeId, workItem, configuration) {
var multiselect = workItem.getValue("com.ibm.team.workitem.attribute.colour");
var SplitedString = multiselect.split("|");// here i get the individule values from multiselect
for(var i=1; i<SplitedString.length-1;i++)
{
// how to loop into to set the attribute label
as we have workItem.getLabel what do we have for setlabel ?

Thanks in Advance!

0 votes


Accepted answer

Permanent link
You say the attribute name should change. This is not supported.

If you refer to the attribute value to change, then this is a completely different matter and calculated values might be a possible solution.

Dependent enumeration is a different thing, basically limiting the possible value choice in one attribute based on the value in another one. You can find information about the API e.g. setValue() in https://jazz.net/wiki/bin/view/Main/AttributeCustomization Lab 5 and https://jazz.net/library/article/1093.

Note, you can only set the value of an attribute. The value then determines the value (label) displayed in the UI.
Deepali Deshmukh selected this answer as the correct answer

0 votes


One other answer

Permanent link
 As far as i can tell, there is no API to do anything like this.

0 votes

Comments

 I am not sure but using enumeration field dependent on other attribute and calculated value set  it is possible. 

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
× 7,494
× 6,121
× 1,700

Question asked: Dec 09 '16, 2:11 a.m.

Question was seen: 3,607 times

Last updated: Dec 09 '16, 4:07 a.m.

Confirmation Cancel Confirm