How to use javascript to add tag
I am trying to "save" Pland for history using Tags. I am trying to add tag for every "Planed for" value using attribute customisation -> Script base Value set.
my script is:
I set the Tag to use the script & add Planed for as dependencies.
I dont get any value in the Tag.
can I set the Tag this way? is there another way do add tag?
thank you
|
One answer
I have not been able to implement what you want to do but have found a few things that you need to take care of.
1. The "Tags" attribute appears to be expecting a "collection", not an "array". I found it out in the error message that I got. 2. workItem.getValue(WorkItemAttributes.PLANNED_FOR) returns the internal Id, not the label such as "Release 1.0". 3. Tags only allow a single word, and the enumeration label needs to be converted before passing on as a tag. Comments The JavaScript API provides workItem.getValue() (provides the ID of the item for more complex items) and workItem.getLabel() which describes the display value.
Shmulik Tamari
commented Jul 07 '14, 11:12 a.m.
thank you for your answers. since it become more complicated then I thought, I use the SDK to solved it.
Jonas Studer
commented Jul 08 '14, 5:02 a.m.
Am I right, you wanted to change a Workitem State e.g. from "new" to "Planned for" or did you just wanna set a tag?
|
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.