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

How get "Found In" attribute with RTC SDK?

Hello!
We develop a follow-up action trigger which gets the attributes (names and values) from workitems which are changed. We can get almost any attributes for an RTC workitem. But we can not find "Found In" attribute (or release number) which is defined in releases list of a project area.
Can anybody recommend us how we can get this value from IWorkItem or another way?
The environment is Jazz CLM v4.0.5.
Thank you in advance!

0 votes


Accepted answer

Permanent link
 Simply use
IWorkItemClient workItemClient = ((IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class));
IAttribute attribute = workItemClient.findAttribute(projectArea, attributeId, null);
To find out the attributeId do the following:
- Open the project area in the eclipse client
- Choose 'Process Configuration' tab
- Navigate to  Project Configuration -> Configuration Data -> Work Items -> Types and Attributes
- click a built-in attribute and choose Edit
- instead of the whole ID path (like 'com.ibm.team.workitem.attribute.modified'), only use the last part ('modified').
---> for custom attributes, you have to use the whole path (like in the source code above)

(a part of this answer is from my answer on this topic)
Dmitry A. Lesin selected this answer as the correct answer

0 votes

Comments

Hi Lucas,
I was having a suspicion that I need to go this way but I stopped my investigation too earlier!
Thank you very much! I'm sure this topic will be helpful for other who goes this way.

 The advantage if this code is that it is generic for built in and custom attributes, that's why I prefer it over the approach Susan Hanson suggests below.


One other answer

Permanent link
I don't actually read it, but I do set it using this logic:
            IAttribute foundInAttr = myRepo.findAttribute(IWorkItem.FOUND_IN_PROPERTY);
            IDeliverable del = myRepo.workItemClient.findDeliverableByName(myRepo.projectArea, name, IDeliverable.DEFAULT_PROFILE, myRepo.monitor);
            newWorkItem.setValue(foundInAttr, deliverable.getItemHandle());

I would assume once you have the foundInAttr, you could do something like
IDeliverable del = (IDeliverable) oldWorkItem.getValue(foundInAttr);

0 votes

Comments

I would also suggest to use the IWorkItem interface to get at the constants for the built in attributes. E.g. IWorkItem.FOUND_IN_PROPERTY

Colleages!
Thank you very much to everybody!
And I'm sorry! I'd like accept all answers but System doesn't let me to do it!

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

Question asked: Apr 01 '14, 6:36 a.m.

Question was seen: 4,032 times

Last updated: Apr 01 '14, 7:27 a.m.

Confirmation Cancel Confirm