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!
Accepted answer
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.
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.