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.

5 answers

1 accepted

6 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?

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 James G. likes this

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)

0 votes

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.

0 votes
James G. I'm New Here Oct 09, 2019

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.  

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

344 views 1 3
Join discussion

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