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

Read and write to customized attributes

Hi,
    
I add new custom attribute type 'Tag' When I manage it through the GUI it is working great (every tag window, have it own value)

RTC version is 4.0.4

I'm trying to write some code to add it by programmatically, I run over a query, and then I enter every WI.
The code the add Tag is : workItem.setTags2(List);

But I can't use this since my Tag attribute is customized.

So I try to use: iAttribute.getValueSet(auditableCommon, workItem, monitor);
This class return Object[];

"Object[] com.ibm.team.workitem.common.model.IAttribute.getValueSet (IAuditableCommon arg0, IWorkItem arg1, IProgressMonitor arg2) throws TeamRepositoryException"

I can't figure out how to use it, what is the Object should be casting by?
How can I read and write the customized attributes?

Thanks
Kunal

0 votes


Accepted answer

Permanent link
You need to
  • Use the attribute ID to get the attribute
Then you should be able to get the value and also set values. See https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/ (I don't handle examples like tags)

Since Tags is a more complex type you need to know how to cast it and how to add/set values. I would look into the code of setTags2() to figure how that is done. Look at https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/ to get an idea how to set up the SDK and the plain Java client libraries to be able to look at the code.
Kunal Doddanavar selected this answer as the correct answer

1 vote

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
× 12,019

Question asked: Jun 11 '14, 2:45 a.m.

Question was seen: 3,329 times

Last updated: Jun 11 '14, 3:30 a.m.

Confirmation Cancel Confirm