CSV Import to "Filed Against" field
I need to import a number of work items from a CSV file into RTC. The mapping I have created, however, does not seem to work. Lets assume that the value read from the CSV file will be "Test." I noticed in Categories tab that all of my categories fall under a root category called "Unassigned."
To import these values, I have tried:
<value sourceId="Test" targetID="Test" />
<value sourceId="Test" targetID="Unassigned/Test" />
Neither of these seem to work. I tried setting the field manually and exporting the work item's Filed Against field's internal value, but that gave me a value something like _Y0BWgAghEe.
Is this field mapping supposed to map to some sort of path (like the Planned For field) or some internal value such as priority.literal.l11 (the ID for the High priority value), or something else entirely?
Thanks,
- Josh
Accepted answer
The targetId should be the same value as the name of the Category you see in your Categories tab. You can ignore the "Unassigned" root, however, if there is another level between "Unassigned" and "Test", you'll need to include it, i.e. "Parent/Test".
Is the rest of the mapping xml correct? Assuming the header for this column in your csv is "Filed Against", the xml should look like:
<attribute sourceId="Filed Against" targetId="com.ibm.team.workitem.attribute.category">
<value sourceId="Test" targetId="Test"/>
</attribute>
Comments
Hi Brian,
Alright, I assumed it was supposed to be name of the category. The mapping actually looks something like this (cutting down the number of values):
<attribute sourceId="Component/s" targetId="category">
<value sourceId="OD - Scheduling" targetID="OD - Scheduling" />
I tried using "com.ibm.team.workitem.attribute.category" instead of just "category" in the attribute tag, but that didn't affect anything. I thought maybe the hyphen was causing a problem, but the "Billing" value also does not work, and I receive no errors from RTC when importing. There are no parent categories - everything is under the Unassigned/Root category I described in my original post. And yes, the rest of the mapping xml is working as intended.
I should also probably specify we are using RTC 4.0.1.
Thanks,
- Josh
Interesting. I can reproduce it using the same sourceId "Component/s" as you. It must be the slash that is causing the problem. Can you change that to "Component" in both the mapping xml and the header in your csv? When I used the following it worked:
<attribute sourceId="Component" targetId="com.ibm.team.workitem.attribute.category">
<value sourceId="JKE/RelEng" targetId="JKE/RelEng"/>
</attribute>
Hmm, strange. I have another field named "Fix Version/s" and that field maps properly. I'll try that and see if it works. Thanks!
EDIT: Yep, that was the problem after all. Baffles me that it works when the slash is in the second word. Thanks again!