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;
}
});
})();
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
"_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);