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

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;

  }

});

})();

0 votes


Accepted answer

Permanent link
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

0 votes


2 other answers

Permanent link
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

0 votes

Comments

Thank you so much Dinesh!. Its working fine.


Permanent link

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,

0 votes

Comments

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

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,936

Question asked: Mar 05 '15, 10:33 a.m.

Question was seen: 4,522 times

Last updated: Jan 03 '18, 5:58 a.m.

Confirmation Cancel Confirm