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
![]()
Ralph Schoon (62.3k●3●36●43)
| answered Mar 05 '15, 11:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Mar 05 '15, 11:04 a.m.
According to https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_Example the attribute ID is
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. Rajiv Gandhi selected this answer as the correct answer
|
2 other answers
![]()
Dinesh Kumar B (4.1k●4●13)
| answered Mar 05 '15, 11:01 a.m.
JAZZ DEVELOPER edited Mar 05 '15, 11:01 a.m.
modify your function to declare a variable like this :
(function() { var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes; then you could use :
workItem.getValue(WorkItemAttributes.
in your script. for more details : https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_built_in_attributes_of hope this helps |
![]() I want to achieve the same, need to get the value of FoundIn from parent item and then set the same value to child wotkitem's FoundIn attribute. Is it possible through javascipt? were you able to ahchieve this? Many Thanks, |