How to Import an attribute type of Item into RTC via a CSV file
![](http://jazz.net/_images/myphoto/a8cc7369643f532d528ab936f06d14ba.jpg)
We have a custom attribute defined as follows. We need to be able to import the values of the attribute which are references to existing RTC workitems.
Attribute Name: Driving RFC
Attribute Type: Item
Attribute ID: cris.drivingRfc
I have already tried the following formats for the CSV file based on the assumption that an Item is essentially a link. The last attempt was with the <ID>: <Summary> (as this is how RTC exported the field). However, none of this has worked yet, and I can’t seem to find any documentation covering this.
Attempted CSV Formats:
Id, Driving RFC
123, 456
123, #456
123, 456: Test RFC
Attribute Name: Driving RFC
Attribute Type: Item
Attribute ID: cris.drivingRfc
I have already tried the following formats for the CSV file based on the assumption that an Item is essentially a link. The last attempt was with the <ID>: <Summary> (as this is how RTC exported the field). However, none of this has worked yet, and I can’t seem to find any documentation covering this.
Attempted CSV Formats:
Id, Driving RFC
123, 456
123, #456
123, 456: Test RFC
One answer
![](http://jazz.net/_images/myphoto/a8cc7369643f532d528ab936f06d14ba.jpg)
This was determined to be a limitation, under work item
https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=372889
A potential work around is to create a new attribute of type "Work Item" and update the csv to import to that attribute instead. (You would have to update presentation editor, and optionally existing work items as well).
The format for importing to this attribute type is #WI_number
Example csv:
"Attribute Of Type Work Item"
"#19"
Comments
sam detweiler
Oct 06 '15, 5:24 p.m.I don't think RTC provides any mechanism to hold another workitem ID in a field, so import probably will not work. the documented way is links.
1 vote
Mike Ballard
Oct 06 '15, 5:33 p.m.Sam,
Thanks for the response. We purposely used a built-in type of Item in order to avoid these types of issues. The Item type allows you to create a singular reference to another work item in RTC as an attribute instead of a link. For the most part, it seems to work pretty well until we tried importing values into the attribute.
-Mike
sam detweiler
Oct 06 '15, 5:40 p.m.yeh, always fun trying to cover the entire use case.
you might try the UUID of the other workitem. but I don't know an easy way to get that.
if you use my sample app to dump the attributes, I wonder what it would show for that attribute.. write a query to select the workitems to dump.
see the accepted answer code here
https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes
don't know if my code would handle 'item' anyhow.
Mike Ballard
Oct 07 '15, 9:12 a.m.I grabbed the values for the uniqueId, contextId, itemId, href and the reportableUrl via the RTC REST Reportable API and tried different methods of importing using those values as the reference for the Item. Unfortunately, none of these worked.
sam detweiler
Oct 07 '15, 10:57 a.m.I used my utility to dump out that kind of attribute holding a workitem
processing for variable=saveitem attrib type=item kind=_meta custom attribute
attribute id=com.sd.workitem.story.saveitem, type=item value=com.ibm.team.workitem.common.internal.model.impl.WorkItemHandleImpl@5b48f6b8 (stateId: <unset>, itemId: [UUID _wjUx4D7gEeSUIoZsNfPZ_g], origin: com.ibm.team.repository.client.internal.TeamRepository@33e1fcdc, immutable: true)
so it is holding the workitemHandle UUID.
sam detweiler
Oct 07 '15, 10:57 a.m.and if I do an Export, with that field and select internal value, it give me the UUID
CSV header
Approvals,"Found In","Id","saveitem","Severity","Summary"
so maybe UUID as input would work.
Mike Ballard
Oct 07 '15, 3:17 p.m.Sam,
I have tried using the itemId (UUID) as the input and it doesn't seem to work.
I appreciate all of your help and ideas.
sam detweiler
Oct 07 '15, 5:47 p.m.yeh, tried it here too.. looks like import to item is not supported. altho export from is