How can I get value from "Found In" Attribute for a RTC defect workitem?
I want to get value from “Found In” attribute and set the same value in another attribute in defect workitem. I have experience to get value from enumeration attribute type but I could not able to get value form found In attribute. I have created below code for my requirement. So could you please check my code and let me know the correct code?
FYI:
dojo.provide("Valueset");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
dojo.declare("Valueset", null, {
getValue: function(attribute, workItem, configuration) {
var foundIn = workItemClient.findAttribute(projectArea, workItem.FOUND_IN_PROPERTY, monitor);
var deliverable = workItem.getValue(foundIn);
return deliverable;
}
});
})();
Accepted answer
WorkItemAttributes.FOUND_IN
.
Please note, the item that is behind it is complex. You will only be able to get the name (getLabel()) and the UUID (getValue()). You can not access any more date using JavaScript.
2 other answers
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
then you could use :
workItem.getValue(WorkItemAttributes.
FOUND_IN
)
in your script.
for more details : https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_built_in_attributes_of
hope this helps