How to properly import the subtask relationship between issues?

Hello! We have a custom script here, that parses the entire XML-dump of a Jira instance to create separate JSON-files for each project, that we wish to import. We are using this to consolidate our several JIRA-instances into one.

Everything is peachy except for the creation of subtasks (other issue-relationships got created nicely).

The subtasks are special, because they use one more attribute -- "sequence" (populating the SEQUENCE-column of the issuelink-table in the JIRA database). I see the "sequence" attribute in the XML-dump of the source JIRA-instance:

<IssueLink id="10012" linktype="10000" source="10405" destination="10465" sequence="1"/>

but I can not add it to JSON as one more attribute of a link -- JSON-importer bombs. If I do not add it, then JSON importer runs smoothly, but the HTML-rendering of any ticket containing any subtasks will include a nasty Java exception. See JRA-34729 for more details -- the above-mentioned SEQUENCE-column of the issuelink-table remains set to NULL...

Though I'm certain, the problem will be fixed soon, what can we do now to work around it? Can the same relationships between already existing tickets be imported via CSV or some other format? Can I simply update the SEQUENCE field directly in the database? And, if so, will such DB-manipulation require a JIRA restart?

Please, advise. Thanks!

2 answers

Hello,

Currently there are two ways of importing subtasks via JSON Importer:

1. Via "jira_subtask_link":

{
        "name": "jira_subtask_link",
        "sourceId": "SAM-1",
        "destinationId": "SAM-2"
    },

But this way is not working correctly! It's not adding sequence into database, so it's causing the Issue Page to be rendered incorrectly. We would like to add "sequence" property into the JSON Link object, but it will happen for one of the future JIM releases. You could try to manually change the sequence column in Database, but it's not a recommended solution.

2. Via "sub-task-link":

{
        "name": "sub-task-link",
        "sourceId": "SAM-3",
        "destinationId": "SAM-4"
    }

That's a recommended way of creating subtasks with JSON Importer. It automatically adds "sequence" property to link, so issue page is rendered correctly. However it requires the child issue to have one of the Sub-Task Issue Types (This can be found in your JIRA instance: Issues -> Sub-Tasks menu) and that's ok, because that's what JIRA expects there to be. Currently it's not checked when you are using the 1. way, but it's a hack and I think we will no longer allow to do it.

Just got this error:

 

errorMessages=[No issue link type with name 'sub-task-link' found.]

 

any ideas?

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,026 views 12 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot