How do we stop duplicate categories being created when importing work items from a csv file?
We are successfully importing work items from a csv file but are seeing duplicate categories created. Specifically the import sometimes has items with a category and sometimes with the same category and a sub-category. This is causing the category to be created twice, once as a category with no sub-categories and again as a category with sub-categories. When writing a query there are then 2 identically named categories to chose from which return different work items i.e. those with just the category and those with the category and a sub-category. This looks like a bug? As a work-around we could create a dummy 'Unassigned' sub-category in the csv file so that all items have both a category and sub-category.
Accepted answer
Given Martins comment
Martin, if this summarizes the matter, please accept.
I have investigated further and it doesn't occur if the single category import item occurs first, but the problem does occur if a single category import item occurs after a category/sub-category item e.g. with the following csv import file 'Category1' is listed twice on the 'Work Item Categories' tab.I would suggest to make sure to create the categories or to provide work items in an order that creates the categories. I would also suggest to create a defect, as I would expect the categories to be created correctly.
"Type","Filed Against","Summary"
"Task","Category1" / "Sub-Category1","task 4"
"Task","Category1" / "Sub-Category2","task 5"
"Task","Category1","task 6"
Martin, if this summarizes the matter, please accept.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Nov 11 '14, 8:15 a.m.Since there are so many versions out now, it is a good practice to mention the one you are using. I am aware that there was a defect where the recognition of the categories did not work as expected. That caused the issue. Your case might be a different one.
Martin McAuley
Nov 11 '14, 8:38 a.m.sorry forgot to say it is 4.0.6
sam detweiler
Nov 11 '14, 8:46 a.m.what is the value of the category in the CSV file?
a path root/cat/subcat
or just
subcat?
I found that changing the output on the export to the path made the import correct..
on the 'choose attributes to export' dialog, click the dropdown and select Internal Value (we needed to do this for iteration and category)
Martin McAuley
Nov 11 '14, 9:19 a.m.The import csv contains entries of the form "category" / "sub-category" i.e. no path-root. It does not seem to need the path-root as this format creates the category and sub-category as expected under the path-root. It is just that we end up with separate path-root/category (from imported items that don't have a sub-category) and path-root/category/sub-category (for imported items that do have a sub-category) for the same category. Following your suggestion I can see that the internal-value is a uuid, however that does not help as we are generating the csv from another non-rtc system.
sam detweiler
Nov 11 '14, 10:08 a.m.could you show us a sample of the different category strings in the csv file and results.. cause I'm not quite sure I understand..
Martin McAuley
Nov 11 '14, 10:39 a.m.I have investigated further and it doesn't occur if the single category import item occurs first, but the problem does occur if a single category import item occurs after a category/sub-category item e.g. with the following csv import file 'Category1' is listed twice on the 'Work Item Categories' tab.
"Type","Filed Against","Summary"
"Task","Category1" / "Sub-Category1","task 4"
"Task","Category1" / "Sub-Category2","task 5"
"Task","Category1","task 6"
Rosa Naranjo
FORUM MODERATOR / JAZZ DEVELOPER Nov 12 '14, 4:51 p.m.Sam, Ralph, or Martin, if one of you think that one of the above comment is an answer for this question, please convert your comment to an answer so this question can be marked as answered.
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Nov 13 '14, 3:13 a.m.My comment is certainly no answer.