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
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
You need to
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.
- Use the attribute ID to get the attribute
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.