Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I would like to import 'Story' and 'sub-task' from CSV to JIRA linking the sub-tasks to New or existing Stories (e.g. TEST-422)
The example I found in the documentation of a similar CSV is of:
Issue Id, Parent Id, Summary, Issue Type
1, , Test, Story
2, 1,ST For Test, Sub-Task
3, 1,ST For Test, Sub-Task
But this cannot be used as I do not have the 'Issue ID' for the new or existing stories, only the 'Issue Key' or in some cases only the issue textual title (summary)
Would appreciate a simple example on how this could be done.
You do need the Issue ID for subtasks - this is the one single unique identifier for the parent issue, and without using that, there's no reliable standard way to add subtasks to a parent. Summary isn't good enough, it's perfectly possible to create issues with duplicate summaries.
So, there are two possibilities to talk about here.
The second sounds like what you are trying to do, and it's a bit of a faff, although I can't see any more simple way to do it really.
Create TWO columns in your CSV. Call one of them something like "Sequence" and the other "My Parent". The sequence is effectively going to be a temporary unique id for JIRA to look at when trying to create subsequent subtasks, and the parent field is the thing to tie them together.
Taking your example (and repeating it a bit for hopefully improved clarity)
Your data is:
You need to create CSV
What JIRA does here is look at, but not import, the "Issue ID" column. The column is there to provide a simple unique identifier in the csv, not in JIRA.
The second column says "I am a subtask, and I belong to the line in the CSV with the Issue ID of xxx". Again, JIRA will not import it, it is just for tying subtask to parent during the import.
Note - I've always done this using a simple sequential number for "Issue ID" - spreadsheets can do a simple click and drag trick or use a formula for "cell above + 1" to generate the sequence. Obviously, these need to be unique, but I don't really know that they have to be sequential. Also, I think order matters - I've always ensured that a parent issue is higher in the CSV that any of it's subtasks.
Thank you Nic!
Your answer clarified very well to me how to add new Stories and Sub-Tasks together in a CSV (2)
Is there a way to do option (1) - add sub-tasks to existing JIRA Stories?
Is there a way to get the Issue-ID to be added to the CSV? (maybe by using the Issue-Key?)
I have no problem adding this manually to the CSV after looking it up, just need to know how.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As I said for 1, use the existing issue ID
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am not sure I know how to get the it: The Issue-Key is the visible name that changes per JIRA DB (e.g. TEST-422) The issue-ID should a non-changing key ; where is it made visible for existing JIRA items (stories)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh, sorry, I've used the phrases unclearly. The key (test-422) is the one you need to use in your csv. The issue-id (10255) is rarely exposed to the users directly and is not really made visible anywhere.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it's not working. I did exactly the same as you sampled.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
doesn't work. The sub-tasks get created as orphans when trying to import to existing stories
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Add sub-tasks to existing Story through .csv upload
Hi Everyone,
I seemed to have find a way to do it yesterday after many frustrating attempts.
When you create your .csv file, include a column with the Parent ID (The story you are trying to link your subtasks to) but also an Epic Link column (Here you will have the name of the Epic, the Story is linked to).
Please let me know if it works for you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Guys,
I've just figured out that the value of Parent ID needs to be taken from External Issue ID of existing issue.
In other words, the Issue ID mentioned in documentation when importing issue and subtasks from CSV file is External Issue ID, not the id you will see in the issue 's url (it is internal ID)
Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that was in the original answer:
What JIRA does here is look at, but not import, the "Issue ID" column. The column is there to provide a simple unique identifier in the csv, not in JIRA.
The second column says "I am a subtask, and I belong to the line in the CSV with the Issue ID of xxx". Again, JIRA will not import it, it is just for tying subtask to parent during the import.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
oh yes, for new issue with linking subtasks, it is as you have described. However, for existing issue, in case I need to import subtasks to that issue, I will need to use external issue ID
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
I have a common set of stories and tasks which are applicable for all projects. I need to add those stories and tasks in a project through .CSV file. Can you share with me the .csv format. I need to add tasks in Kanban board.
Thanx.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried Nic's solution for Scenario 2 but failed. I tried both "Epic & Story" and "Story & Sub-task" combination and neither succeeded.
- In the "Mapping Fields" step, if I don't map "sequence" field and "My Parent' field, Jira just ignore them. (I am wondering how Jira can parse such two user-defined columns and link them smartly? The column names are not any of the Jira keywords. How does Jira know it needs to link them together?)
- If I mapping the 2 new fields to some existing fields such as "Issue ID" and "Parent ID", then I get an error message that the ID is invalid.
Am I doing something wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since you have mentioned about the creation of issues and the corresponding sub-task for the first time using the sequencing methodology. What type of sequence to follow in the excel sheet for updating the already created stories and sub-tasks?
If I keep Parent id as 1 and Issue id as 2, it creates a new issue instead of updating the existing one. What should be done?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Issue key" : {
"jira.field" : "subtask-parent-id"
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is how I was able to import Stories with Subtasks successfully.
For testing purposes, I kept the columns simple:
Parent id, Issue id, Issue Type, Summary
Jira only uses the Parent id and Issue id for mapping purposes so you can use whatever number scheme you want. For a Story, you leave Parent id blank. For a Sub-task, you use the Issue id of the Story. I still used an Issue id for the Sub-task.
I then mapped:
Parent id > Parent id
Issue id > Issue id
Issue Type > Issue Type
Summary > Summary
On the next screen, I verified the values from the mapping and clicked Begin Import.
And walla!
I was able to import Subtasks using a similar process to the above.
The exception is for Parent id I used the Key to the Story.
The result:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Excellent and clear breakdown. Followed this and had no issues whatsoever. One of our teams needed some help with repetitious task creation in the Cloud JIRA and as the admin I said I would help. This makes it so much easier. Mahalo nui loa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jason,
Thanks for the detailed breakdown. Quick question for you, are you using JIRA Server or Cloud?
We're on the Cloud instance, and I don't have the option for an "Issue Type" during the import. Do I need to configure something in the JIRA Settings?
My import screen also looks different... it doesn't include any of the comments about sub-tasks at the bottom.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After spending a day trying to figure this out, here is the solution.
First, confirm that this functionality exists on your instance:
If you do, this means that your JIRA instance supports the ability to map issue type for a CSV import, but that your edit screen is not configured. If you do not see this setting, unfortunately I do not have a solution.
In the case that you did see the Issue Type in the External System Import tool, you can modify your edit screens to allow all users to add Issue Type during an import. To do this:
You should now be able to select issue Type from the standard issue importer when adding tickets as a normal user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Jason Odra, the screenshots helped a lot!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jason Odra Thanks a million, this worked for my needs!!
I was attempting to import new sub-tasks to existing stories. All I had to do was put the story's issue key (ABCD-123) into the 'Parent ID' field of the sub-task.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jason Odra - Can you please clarify this question. 'Parent Id' or 'Issue Id' is a unique identifier of an issue (Story/Sub-task) that Jira automatically generate while creating an issue. In your example(pasted below), you have used the value of '10000' for 'Issue Id' of the Story. What if the database already has an issue with the same value, Jira would not accept this value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much for the detailed instruction! Quick question, though: is there any reason, when importing sub-tasks only, to actually map the Issue ID? In my test, if I choose not to map the Issue ID, the imported sub-tasks will be automatically assigned an external ID. If the external ID is automatically assigned, it seems less likely to create a collision with subsequent imports to the same project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For anyone else reading this thread, Nic Brough's original post above works perfectly (contrary to some other comments in the thread).
If you are trying to both add sub-tasks to existing stories and create new stories with new subtasks in the same import, I would suggest breaking your data up into 2 separate CSV files (one for each scenario) and doing 2 separate imports. That will simplify things quite a bit. Follow Nic's instuctions above exactly as described for the 2 different scenarios and it will work perfectly.
To add subtasks to existing stories, this is all you need to do (Paraphrasing from above):
Thanks Nic!!!! You saved me a TON of time!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hii Steven,
I'm getting the below error while importing the second sheet which consists of all the tasks with Parent-ID. Can you help me out please.
"You have to define which CSV column maps to Issue Id if you want to import sub-tasks."
Thanx for your support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi M Shaikh,
I'm not sure I totally understand what you are doing with your second import, but if you want to import stories with subtasks, and do it in two steps as I suggested you will have to do the following,
1. Create a CSV file with all of the stories you want to create (No subtasks).
2. Import those stories into Jira. (At that point you can get the Issue ID's from your parent stories that are necessary for mapping your subtasks).
3. Create your CSV file with your subtasks identifying the parent story for each subtask by using the IDs you got above.
Your subtask file columns should look like this
Issue ID | Parent ID | (The rest of your columns)
<Blank> | DEMO-1234 | (Additional column Data)
<Blank> | DEMO-1234 | (Additional column Data)
Each subtask associated with a given parent should have the same Parent ID.
4. Map Parent ID in your file to Issue ID on the import mapping screen.
5. Import your Subtask CSV file.
That should do it. Let me know if that answers your question, and works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Steven Marusic -
there appears to be a contradiction above.
(a) In your paraphrasing above, you have " 3. Map the 'Parent ID' column you created to 'Parent ID' in the import template. "
(b) then later you have "4. Map Parent ID in your file to Issue ID on the import mapping screen"
I too am trying import sub-tasks and map to parent where all parent tasks are already in JIRA.
I tried both approaches
(a) mapping parent_id , which is the parent issue key (ex DEMO-1234) to the Parent ID in the import step. for this, the sub-tasks were created, but are all orphans
(b) mapping parent_id (ex DEMO-1234) to the Issue ID in the import. for this . nothing was imported.
So I wanted to confirm - which field is the Parent key (from the import file) supposed to be mapped to in the import? the Parent id or the Issue Id?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
actually, I deleted all and did it again, and THIS approach did work:
- mapped parent_id in the xls, which is the parent issue key (ex DEMO-1234) to the Parent ID in the import step.
- first time thru,with issue Id not mapped , get error: "You have to define which CSV column maps to Issue Id if you want to import sub-task"
- so I mapped the Issue Id in the file (just some sequential number) to Issue Id in the import
and it worked! no more orphans.
but this statement must be a typo in the summary above: Map Parent ID in your file to Issue ID
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Allison!
Trying to walk through this. I did this awhile ago, and haven't had to do it since, so I don't remember the details. But when I get a few minutes I'm going to walk through it again. If you got it to work the way you described, then that is likely a typo.
Thanks for pointing it out. I don't want to lead anyone else astray :-).
Steve
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Allison,
You are absolutely correct. Statement 3 in my first post should have been 'Parent ID' to 'Issue ID'! Sorry for your wasted time, but thanks for finding the error!
I edited the post above.
Thanks Again!
Steve
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
no wasted time.. I learned a lot by trying different ways.
thanks for the great summary!.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Best explanation yet - so simple ! Thanks a lot, Steven !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Appreciating Steven for putting it simple and also Allison for bring out the typo. Kudos guys, you all saved a lot of time on trials :)
Thank you so much !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I have task and Subtask in jira in one project. Now i want to link already created subtask with already created task. how can i do and which field i need to consider. i do not want to create new task and subtask.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Add sub-tasks to existing Story through .csv upload
Hi Everyone,
I seemed to have find a way to do it yesterday after many frustrating attempts.
When you create your .csv file, include a column with the Parent ID (The story you are trying to link your subtasks to) but also an Epic Link column (Here you will have the name of the Epic, the Story is linked to).
Please let me know if it works for you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is something which I created and worked for me in my JIRA project.
With this template, we can create multiple subtasks under a user story present in JIRA. Create a .csv file with the columns as mentioned in the attached image.
Only point to note is map - Issue key to Parent Id while you map the fields from .csv to JIRA fields.
Do let me know, if this helps.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
All are giving wrong answers and Even JIRA documentation is wrong. The parent ID should not be numerical but the existing key. Here is example of how to add sub-task to existing task or story. All are giving wrong answer by importing new task and sub-task.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
While mentioned early on in this thread, it's important to realised that the Issue ID that you put in your CSV is stored as External Issue ID in Jira.
What this means is that
a) if you attempt to import a CSV file that uses the same "unique ids" used previously for new tickets, it will fail to import them as they "already exist"
b) if you import a CSV with subtasks with the Parent ID the same as an existing External Issue Id they will be applied to that existing ticket.
To illustrate, if I import a CSV with the following values
Tickets 1 & 2 will have External Issue ID's as 1 and 2 respectively and will have the sub tasks linked.
If I attempt to load a new CSV like this
Tickets 3 & 4 will not be created as the "ID" already exists. Additionally the two subtasks in this file will be allocated to the original Tickets 1 & 2 respectively that were previously imported.
This implies (and I'm yet to verify) that to make this work, all Issue IDs used in all CSVs imported into a project must be unique for all CSV's, not simply the one you are importing currently.
If this is the case, then making the Issue ID value in the CSV based on the current date/time is the only way I can see multiple imports working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe you can also accomplish this using the Deep Clone add-on
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for mentioning Deep Clone for Jira, @Chris Hugenberger !
It's possible to bulk clone Subtasks and link them to any existing parent issue with our app.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Team,
Can any of you please help me with bulk import of new stories with sub tasks . I have tried exactly the same how @Jason Odra mentioned in his example but does not work for me. i see errors.
Thanks & Regards
Divya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nic Brough Please need your help - Allow to create Parent Issue and Subtask in single import . I have tried the way you mentioned in above example but unable to succeed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried doing what was explained in the accepted answer?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Nic Brough -Adaptavist-
Below is the format of my csv file. I have made an excel first before saving as CSV. Can you please help where i am going wrong.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How are you mapping the parent id and issue id columns?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1) Create and Excel with Issue ID, Issue Type, Parent ID, Summary
2) Issue ID is the 6 digit number, Issue type is 'Sub-task' , PArent id is 'Issue key', Summart is 'What you want as Sub task'. Save Excel as CSV
3) Click on Issues drop down, select upload through CSV
4) Upload CSV, map all fields as mentioned above
5) And done
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey, just wanted to let you know the solution of adding a new column with the parent link to the subtask, also worked for me!
Below, I've selected the column I've created in the CVS export, where I added the parent link.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there
I managed to get the import to work correctly, however the sub tasks are not showing on portfolio whilst they show linked correctly in the jira issue screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi I fixed this, do not use the Epic link as suggested in one of the comments above. Removing the pic link from the sub tasks (which shouldnt have an epic link) resolved the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Succeeded importing subtasks to existing issues.
- you will need 2 separate columns
a) issue id
- this is the sequential unique identifier (for the subtasks to be linked to existing issues) mentioned in previous post.
b) parent id
- this is the 'issue key' for existing issues. I was confused by 'id' as I used the "issue id" (the unique number for an issue, start with 5 digit, you can get it by "Export Excel CSV (all fields)")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am receiving following validation error
Even though I have selected a valid parent id from CSV export and its a 6 digit number. Any other pointers ?
arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Succeeded,
mine worked with using the "Key" field (also used as Rank in ORDER BY function)
using the 5-6 digit Parent Id didn't work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you!!! I had same issue...
Not sure why Jira maps Parent ID with Issue Key... but finally works :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Adriana. This is really helpful! I used Issue Key as Parent ID to import subtasks. It works!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you link stories and task together via CSV import? Issue type Story and task (not sub-task).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.