It's all about the answers!

Ask a question

How do you set calculated value for a Tag attribute


Fran Burgos (12311550) | asked Apr 10 '18, 10:31 a.m.
On a javascript, what is the format for return tags on a workitem calculated value?

dojo.provide("com.ibm.san.workitem.js.clasificaciones");

dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

(function() {
dojo.declare("com.ibm.san.workitem.js.clasificaciones", null, {

getValue : function(attribute, workItem, context) {
return ["tag-1", "tag-2"];
                        // String array? It doesn't seems work.
        }
}

Accepted answer


permanent link
Ralph Schoon (62.0k33643) | answered Apr 10 '18, 11:46 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

As far as I can tell, the Java API expects a collection of strings. I am not aware if there is a way to provide that using the AttributeCustomization API. Maybe someone else is able to, but I have so far not succeeded in setting multi value attribute types. Also please note that https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript only mentions very basic types as supported.

If you read the Tags, you get a string like "tag1, tag2, tag3".


Fran Burgos selected this answer as the correct answer

Comments
Fran Burgos commented Apr 11 '18, 3:58 a.m.

I tried returning that string and it works:


return "tag1, tag2, tag3";

Thank you.


Ralph Schoon commented Apr 11 '18, 4:09 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

This is surprising, because for whatever reason I got an exception when I tried.

Your answer


Register or to post your answer.