It's all about the answers!

Ask a question

How can I get value from "Found In" Attribute for a RTC defect workitem?


Rajiv Gandhi (34712) | asked Mar 05 '15, 10:33 a.m.

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


permanent link
Ralph Schoon (63.1k33646) | 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



permanent link
Dinesh Kumar B (4.1k413) | 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. FOUND_IN )

in your script.

for more details : https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_built_in_attributes_of

hope this helps

Comments
Rajiv Gandhi commented Mar 05 '15, 12:25 p.m.

Thank you so much Dinesh!. Its working fine.


permanent link
deepti harinkhede (219) | answered Dec 18 '17, 1:10 a.m.

Hi @rajivcmejazz

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,


Comments
Ralph Schoon commented Jan 03 '18, 5:58 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

You can not access another work item using the attribute customization JavaScript API.

Your answer


Register or 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.