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

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

 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

0 votes


Accepted answer

Permanent link

 "_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

1 vote


One other answer

Permanent link

 Thanks a lot for this solution.

0 votes

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
× 10,927
× 152

Question asked: Jan 09 '19, 4:07 a.m.

Question was seen: 2,689 times

Last updated: May 30 '22, 6:37 a.m.

Confirmation Cancel Confirm