It's all about the answers!

Ask a question

How to import Stories and Tasks in RTC while preserving relations between them?


Christine Lambert (111) | asked Jan 10 '14, 3:20 p.m.

I have a csv file with a list of stories and tasks.

I want to import them into TC.

I have configured the stories (column names, ...) to import them properly.

Now I would like to import the tasks with the stories while preserving the relations between them.

Is there a way to do this without needing first to import the stories, then capture the ids and needing to type the stories ids on the tasks all by hand?

One answer



permanent link
sam detweiler (12.5k6188201) | answered Jan 11 '14, 7:30 a.m.
edited Jan 11 '14, 7:30 a.m.
I just created an export from workitems with parent/child links, like this query is workitems where a Parent or Child link exists.

Type Id Status Priority Severity Summary Owned By Created By Children Parent
Story 7 New Unassigned Normal foo Unassigned sam #8
Task 8 New Unassigned Normal test child Unassigned sam
#7

you do this by selecting the Add Columns button on the export, select the Links checkbox, and then the link types that u care about.

on import this data is used and the relationships are rebuilt on the new workitems.

attachments are not recreated, altho the attachment name is exported.

so, Yes, if you have the column names matching the relationship

Comments
Christine Lambert commented Jan 13 '14, 9:44 a.m.

Thanks for the info.

In my case the data do not come from an RTC export they come from another tool. I do have Id columns and parent relation, but those id do not match RTC Id pattern. I think it would be easy to convert the Ids I have to some Ids RTC would accept.

But how do I know what Ids RTC will accept?


sam detweiler commented Jan 13 '14, 9:56 a.m.

in the list you would have a workitem with ID =8, and then another workitem with ID=22, which is a child of workitem 8. 


that is what the importer needs to know..

when u say 'create new workitem', it gets the new ID for wi8, and then fixes up the other records.


Christine Lambert commented Jan 13 '14, 11:21 a.m.

I've tested and in fact it does not work. If I set an Id for a story that is not already in RTC, A new one will be generated and my Id will be ignored.

So the only way I see to link Stories and Tasks is to know in advance the Ids for Stories and to set them on Tasks. And this means importing the Stories first and then getting the ids and setting them on the tasks. This can be very long and error prone when you import a big bunch of Stories and Tasks.


sam detweiler commented Jan 13 '14, 11:38 a.m.

 I tested this specifically to answer your question (and I wanted to know as well).


I created a set of workitems with parent/child relationship.

workitems 7 and 8 as shown above. 

I exported those workitems to a CSV,

insuring that I had the ID column, and the parent and child links columns as I described.

each record has three columns of interest
ID (its existing ID)
parent (the #n of it parent workitem if any)
child  (the #n of the child workitem if any)

I then imported those workitems. 
and got workitem 11 and 12.
where 12 is the child of 11
in the export is says that 8 is the child of 7.

Your answer


Register or to post your answer.