CSV Import into Jira - Creating Sub-Tasks using Issue ID

wtamisin December 7, 2011

I've been importig projects into Jira via CSV. I've followed the instructions provided here: http://confluence.atlassian.com/display/JIRA/Importing+Data+From+CSV

My question is on the Issue ID / Parent ID fields I use to create a User Story and its Sub-Tasks. Here are the instructions I follow:

  • Firstly create a column for every 'Issue Id'(it can be any unique string), then create a second column for the 'Parent Id'. To import sub-tasks reference the Issue Id in the Parent Id column.

Currently, I keep a list of used Issue IDs. I'd rather be able to query Jira for a list of unique Issue IDs. Does anyone know how to query Jira for this information. Or if the Issue ID can be re-used to create a new Story. Iassume it is saved in the Jira DB.

7 answers

0 votes
Jerome LeBlanc August 3, 2016

More recent versions of JIRA appear to allow this now.  See https://ecosystem.atlassian.net/browse/JIM-421.

0 votes
Saint Germain July 26, 2012

I got bitten by the same "bug".

I opened an issue here:

https://studio.atlassian.com/browse/JIM-790

0 votes
Nicholas Gianniotis April 5, 2012

I too am having this issue. Even after a complete restart of JIRA, attempting to import new issues into an existing Project, using Issue IDs in the CSV that you used before, will result in those issues being reported as already existing.

[...]

2012-04-06 11:58:07,743 INFO - External issue 1 already exists as 2012_JP_XXX_0-1, not importing.

[...]

Nicholas Gianniotis April 5, 2012

I am trying to find where the JIRA Importers Plugin stores this state. I've looked in cache directories and inside the DB but I can't find any clue as to where the IssueIDs encountered in prior imports are stored. Anyone know?

0 votes
Richard Becker March 25, 2012

Finally got some time to test and the answer is no, simply disabling the plugin and then re-enabling it does not clear out any cached issue ID's. I get the same behavior as I mentioned before

0 votes
Richard Becker February 14, 2012

That is actually incorrect. I have a CSV file with one issue and a number of subtasks defined. If I import that exact same file twice (I change the issue summary for the second import just to keep track of it) it will compain the second time that the issue already exists (even though summaries are different) and then it will add duplicates of the subtasks to the already existing issue

Wojciech Seliga
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.
February 14, 2012

I think that you have just spotted a bug, not a feature. I guess you have spotted it because of a cache of issue ids (auto-generated or explicitly set) which is maintained by JIRA Importers Plugin and not cleared between imports in order to support incremental import from 3rd party issue trackers (e.g. project by project import from Bugzilla with maintaining issues links between issues from different projects, imported in a different runs).

If you restart your JIRA instance (or even disabled and enable JIRA Importers Plugin) then you should not see this behaviour. But I may be wrong. Let me know.

0 votes
Richard Becker February 14, 2012

That is actually incorrect. I have a CSV file with one issue and a number of subtasks defined. If I import that exact same file twice (I change the issue summary for the second import just to keep track of it) it will compain the second time that the issue already exists (even though summaries are different) and then it will add duplicates of the subtasks to the already existing issue

0 votes
Wojciech Seliga
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.
December 7, 2011

That functionality does not allow to import sub-tasks into existing JIRA issues. It supports only importing sub-tasks to the issues imported from the same CSV file. Values from Issue Id and Parent Id column don't get imported into JIRA - they are used solely to tell the importer about parent/child dependency.

So you may use any unique string - using existing Issue IDs will not help you (as your imported subtasks will not get added to existing issues) but should do no harm either (it will be just a unique identifier used inside your CSV file).

BTW: JIRA is good at hiding internal issue ID from the user. You may use REST API to access such info (e.g. <yourJIRAbaseURL>/rest/api/latest/search?jql=), but as I wrote above - you won't need it.

wtamisin December 7, 2011

That's what I thought originally, however, I’m able to add sub-tasks to an existing User Story by leaving the Issue ID blank, and referencing Issue IDs in the Parent ID field from an earlier Import. So Jira must be persisting the Issue IDs / Parent IDs in the DB.

I'll try your suggestion to use REST API to query Jira DB.

Wojciech Seliga
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.
December 8, 2011

I guess you don't use the most recent version of JIM (JIRA Importers Plugin). JIM used to populate External Issue Id also for CSV, but that was actually a glitch. Currently there should be no possibility to refer to existing issues from CSV file.

The proper feature (which we are hoping to implement sooner rather than later) is to have the ability to include any existing issue key in your CSV file and treat it as "Parent Issue Key/Id" column.

Suggest an answer

Log in or Sign up to answer