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.

2 answers

1 accepted

This widget could not be displayed.

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!)

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 widget could not be displayed.
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. 

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

551 views 25 15
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you