How to properly import the subtask relationship between issues?

Mikhail T March 2, 2014

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

1 vote
pborkowski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 3, 2014

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.

0 votes
Peter W. Gstettner May 4, 2016

Just got this error:

 

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

 

any ideas?

Suggest an answer

Log in or Sign up to answer