It's all about the answers!

Ask a question

Read and write to customized attributes


Kunal Doddanavar (45222732) | asked Jun 11 '14, 2:45 a.m.
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

Accepted answer


permanent link
Ralph Schoon (63.5k33646) | answered Jun 11 '14, 3:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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

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.