It's all about the answers!

Ask a question

How to get the value of the field against in API Javascript


Álvaro Alonso (3510) | asked Jan 09 '19, 4:07 a.m.
edited Jan 09 '19, 4:08 a.m.

 Im trying to develop a calculated value and i need to get the filed against but the code returns me this value: "_x88zcPohEeiberd5aDK2Yw"  and the correct value is "RTC Extension Workshop"



dojo.provide("org.example.workitems.providers.filed");

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

(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;

dojo.declare("org.example.workitems.providers.filed", null, {

    getValue: function(attributeId, workItem, configuration) {
var filed = workItem.getValue(WorkItemAttributes.FILED_AGAINST);
        return filed;    
    }
});
})();

Any idea?

Thanks

Accepted answer


permanent link
Ralph Schoon (61.5k33643) | answered Jan 09 '19, 4:24 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jan 09 '19, 4:24 a.m.

 "_x88zcPohEeiberd5aDK2Yw"  is actually the correct value. Complex items are not really supported in JavaScript attribute customization this is documented. For complex items (and all others) you can use the call getLabel() to get a human readable form.


workItem.getLabel(WorkItemAttributes.FILED_AGAINST);

Ralph Schoon selected this answer as the correct answer

One other answer



permanent link
Sudaraazhi Arivalagan (441528) | answered May 30 '22, 6:37 a.m.

 Thanks a lot for this solution.

Your answer


Register or to post your answer.