It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to import stories linked to epics in jira

We have an externally supplied set of user stories, grouped as Epics, which we wish to import into JIRA (CSV).  I can easily import the stories, but how can we import both simultaneously so that the stories are automatically linked to the various EPIC.  I do not want to have to create the EPICs first, we would like to import all at once.

8 answers

1 accepted

7 votes
Answer accepted

That shouldn't be a problem when using JIRA CSV Importer. Simply specify Epic Link mapping in your stories example:

Issue Type,Epic Name,Summary        ,Epic Link
Epic      ,  my-epic,Build a car    ,
Story     ,         ,Build an engine,  my-epic
Story     ,         ,Buy some tires ,  my-epic

The example above will create an epic and link stories to that epic.

Thanks, greatly appreciated. (your user documentation is not so clear on this!)

Like Jordan Glassman likes this

What is the REST parameters needed to set this 'Epic Link' field? is it a custom field in JIRA? what's is value?

Hi, 

I tried this and its not working.  My CSV data looks like this :

 

Project,Issue Type,Epic Name,Summary,Epic Link,Description,Labels,Priority,Original Estimate,Story Points
DTPSID,Epic,Additional Feeds,Additional Feeds,,Additional Feeds,,,,
DTPSID,Story,,DT Go Live|Additional Feeds|ACT Spatial|,Additional Feeds,DT Go Live|Additional Feeds|ACT Spatial|,,,57600,2
DTPSID,Story,,DT Go Live|Additional Feeds|ACT UCV|,Additional Feeds,DT Go Live|Additional Feeds|ACT UCV|,,,57600,2
DTPSID,Story,,DT Go Live|Additional Feeds|Australia Post postcodes|,Additional Feeds,DT Go Live|Additional Feeds|Australia Post postcodes|,,,57600,2
DTPSID,Story,,DT Go Live|Additional Feeds|PSMA Postcodes|,Additional Feeds,DT Go Live|Additional Feeds|PSMA Postcodes|,,,57600,2
DTPSID,Story,,DT Go Live|Additional Feeds|TAS (the List)|,Additional Feeds,DT Go Live|Additional Feeds|TAS (the List)|,,,57600,2
DTPSID,Epic,DAS Integration,DAS Integration,,DAS Integration,,,,

 

 

ERROR LOG SHOWS :

 

16-05-25 16:40:33,544 INFO - Reindexing took 41 ms.
2016-05-25 16:40:33,544 INFO - Importing issue: [externalId='autoid-4020395359902999763', summary='DT Go Live|Additional Feeds|ACT Spatial|']
2016-05-25 16:40:33,554 WARN - Cannot add value [ [Additional Feeds] ] to CustomField Epic Link in Issue with summary 'DT Go Live|Additional Feeds|ACT Spatial|'. Exception Message: null
java.lang.NullPointerException
	at com.atlassian.jira.issue.search.parameters.lucene.DefaultPermissionQueryFactory.collectProjectTerms(DefaultPermissionQueryFactory.java:133)
	at com.atlassian.jira.issue.search.parameters.lucene.DefaultPermissionQueryFactory.getQuery(DefaultPermissionQueryFactory.java:63)
	at com.atlassian.jira.issue.search.parameters.lucene.PermissionsFilterGeneratorImpl.getQuery(PermissionsFilterGeneratorImpl.java:28)
	at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.getPermissionsFilter(LuceneSearchProvider.java:373)
	at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.getHits(LuceneSearchProvider.java:185)
	at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:279)
	at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:91)
	at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:87)
	at com.atlassian.jira.issue.search.providers.DualSearchProvider.lambda$search$0(DualSearchProvider.java:78)
	at com.atlassian.jira.issue.search.providers.DualSearchProvider.performSearch(DualSearchProvider.java:140)
	at com.atlassian.jira.issue.search.providers.DualSearchProvider.search(DualSearchProvider.java:78)
	at sun.reflect.GeneratedMethodAccessor485.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
	at com.sun.proxy.$Proxy98.search(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor485.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
	at com.sun.proxy.$Proxy1202.search(Unknown Source)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.customfields.CFValueHandlerEpicLink.findSingleIssueOrNull(CFValueHandlerEpicLink.java:112)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.customfields.CFValueHandlerEpicLink.prepareCustomFieldValue(CFValueHandlerEpicLink.java:54)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.customfields.CustomFieldValueFactory.prepareRawValueForCustomField(CustomFieldValueFactory.java:69)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.customfields.CustomFieldValueFactory.prepareValueForCustomField(CustomFieldValueFactory.java:53)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.customfields.CustomFieldsUtil.setCustomFieldValueForIssue(CustomFieldsUtil.java:202)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importExternalCustomFields(DefaultJiraDataImporter.java:1305)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.createIssue(DefaultJiraDataImporter.java:922)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importIssues(DefaultJiraDataImporter.java:798)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.doImport(DefaultJiraDataImporter.java:414)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.ImporterCallable.call(ImporterCallable.java:26)
	at com.atlassian.jira.plugins.importer.imports.importer.impl.ImporterCallable.call(ImporterCallable.java:15)
	at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:453)
	at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:421)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:216)
	at java.lang.Thread.run(Thread.java:745)
2016-05-25 16:40:33,736 INFO - Importing issue: [externalId='autoid-3986760313411359137', summary='DT Go Live|Additional Feeds|ACT UCV|']

 

 

 

Even your example comes up with errors :

 

Your example CSV input file :

Issue Type,Epic Name,Summary ,Epic Link
Epic , my-epic,Build a car ,
Story , ,Build an engine, my-epic
Story , ,Buy some tires , my-epic

 

 

ERRORS:

Import completed with 2 warnings:

  • Cannot add value [ [my-epic] ] to CustomField Epic Link in Issue with summary 'Build an engine'. Exception Message: null
  • Cannot add value [ [my-epic] ] to CustomField Epic Link in Issue with summary 'Buy some tires'. Exception Message: null

i have the same problem any solution?

Same issue here - found this JSW-7604 which says it's closed, but I don't think the tech actually tried it.  Does not work the way it is explained.

I have the same Problem, it worked fine to import stories linked to epics about a months ago, now it seem to be impossible. I'm using the same csv file that I used some time ago and it doesn't work any more. It will create the Epic but not link any story or task to it.

Same issue as @Iris Schmid described, used to work previously but not anymore. Epic is created, so is task but not linked.

I can't get this to work either. What is the status to get this working again?

I just tried this again and it is still not working; any updates on a fix?

This seems to be pretty actual still in 2020, especially with the new functionalities of cloud and the next-gen projects.

We had the same problem with next-gen projects on JIRA and found a solution that seems to work.

The step by step solution would be:

1. Export the data in CSV from the project you want to export (choose "all fields")

2. Open the CSV and add two columns; call the columns "Epic Name" and "Epic Link"

3. Optional: if your stories have sub tasks, filter by the column "Issue Type" and deselect all the sub-tasks in your CSV file.

4. Copy the values for the entire column "Issue Id" into the column "Epic Name"

5. Copy the values for the "Parent Id" column into the column "Epic Link"

6. Save your CSV. Have a look at which separator you have (if it is "," or ";" for example)

7. Start the import. Make sure you choose the right separator. Map all relevant fields. Important: map "Issue Type" field to itself. Make sure you map "Epic Link" and "Epic Name" to themselves.

 

I hope this helps somebody, let us know if you find any flaw!

I just wanted to add a couple of details to Mirco's answer for those using JIRA Cloud:

1.) Ensure your Epics are listed before anything that links to them in the CSV file... i.e, put them at the top of the file (under the field names).

2.) Ensure the target project was set up as a Classic project (not a Next-Gen).  As of 1/31/2020, Next-Gen projects do not import Epics correctly in my experience.

3) The values in "Epic Name" should be the same as the values from "Summary" for your Epics.  Epic Name values are only valid for Epics.  Your Tasks should have blank Epic Name values.

4) For all of your Tasks that should be linked to an Epic, put the value of the linked Epic's Epic Name in the Task's Epic Link column.

Example CSV file (spaces added for visual alignment only):

Issue Type,Summary        ,Epic Link  ,Epic Name
Epic ,Build a car , ,Build a car
Story ,Build an engine,Build a car,
Story ,Buy some tires ,Build a car,

  The end result of your import will look like this (in a Kanban board):

Annotation 2020-01-31 143600.png

what works for me:
Issue Type,Key      ,Epic Name,Summary        ,Epic Link
Epic      ,AAA-1    ,  my-epic,Build a car    ,
Story     ,AAA-2    ,         ,Build an engine,  AAA-1
Story     ,AAA-3    ,         ,Buy some tires ,  AAA-1

Appears that Epics import routine is kind of smart, see the last comment here:

That is interesting, your example doesn't work anymore. Instead of the issue id (Key field in your example), Epic Name must be present like this:

Issue Type,Key      ,Epic Name,Summary        ,Epic Link
Epic      ,AAA-1    ,  my-epic,Build a car    ,
Story     ,AAA-2    ,         ,Build an engine,  my-epic
Story     ,AAA-3    ,         ,Buy some tires ,  my-epic

 I'll have to search and replace all epic ID's linked to epic names linked by every story in the exported CSV. It's time for some regular expressions I guess. 

Like # people like this

Did this work? I have 3k issues that got imported without links to epics and need a solution.

Like James_G_ likes this

my version worked for me

This doesn't appear to work at all for Next Gen projects. I've tried everything I can think of, and beyond.

Like # people like this

I'm working in Next Gen now, but previously worked in the older version. The process I used to use to import and link issues to an epic no longer works. The cards are created, but are not linked to the specified epic. 

I have tried using the steps listed in the post dated May 31, 2018, but they imported issues were not linked to an epic. I"m also not seeing "epic link" as an option in the import tool's mapping page.  Any advice? 

I am experiencing same issue.    I have been unsuccessful trying to import stories into an existing epic.  

Like peter.casey likes this

I'm having the same issues as well. Exceptionally frustrating. 

Like # people like this

Epic Link is not an option in the importer for me.

Edit: Fixed - Wasn't in the screen config.

the above doesn't work for me.  
The epics are created, the stories are created, but the stories are not associated with the epics.

What Jira version do you use and what importer? There are 2 (one for global admin, one for project admin)

Jira Server v7.13.2

For me it just has worked in the way, that I've used in the Epic-link column of the User Story the exact 'summary' content of the Epic.

Using Jira Cloud with Nex Gen project also seems to have no mapping to do this.

Trying to use the 'Parent ID' field to import issues with Type = Story throws error (see WARN in bold)

2020-01-09 01:10:55,915 INFO - Importer started!
2020-01-09 01:10:55,927 INFO - Engine is running in Import mode
2020-01-09 01:10:56,137 INFO - All issues will be imported to project: Viz One Upgrade 2019 (VOU)
2020-01-09 01:10:56,166 WARN - Issue 'Build an engine' doesn't have Subtask Issue Type, its Parent Id mapping will be ignored.
2020-01-09 01:10:56,174 INFO - Creating issue: [externalId='autoid--4590135095131978080', summary='Build an engine']
2020-01-09 01:10:56,523 INFO - Issue created successfully with Key [VOU-59], [externalId='autoid--4590135095131978080', summary='Build an engine']
2020-01-09 01:10:56,531 WARN - Issue 'Buy some tires' doesn't have Subtask Issue Type, its Parent Id mapping will be ignored.
2020-01-09 01:10:56,538 INFO - Creating issue: [externalId='autoid--178713755243894322', summary='Buy some tires']
2020-01-09 01:10:56,730 INFO - Issue created successfully with Key [VOU-60], [externalId='autoid--178713755243894322', summary='Buy some tires']

  

I have seen this issue with "permissions" and "null" on Server 7.3.4 and json importer. Snippet from above

2016-05-25 16:40:33,554 WARN - Cannot add value [ [Additional Feeds] ] to CustomField Epic Link in Issue with summary 'DT Go Live|Additional Feeds|ACT Spatial|'. Exception Message: null
java.lang.NullPointerException
 at com.atlassian.jira.issue.search.parameters.lucene.DefaultPermissionQueryFactory.collectProjectTerms(DefaultPermissionQueryFactory.java:133)
 at 


The root cause was this issue: 
https://confluence.atlassian.com/jirakb/blank-page-displayed-when-loading-permission-scheme-configuration-in-jira-server-297670208.html

The project permission scheme was "None" for some reason.

I tried to "save" it but the first option, but did not succeed. I could delete the project as it was test imports, so it was easy to fix that way. Not forced to go for second option of manipulating the database.

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you