What is the correct way to attach Epic Links to issues in Jira JSON import to Jira Cloud?

Wesley Fok December 13, 2018

I can't seem to find a definitive answer to this, and the approaches we've tried have all failed, which means I have to spend time recreating a Jira project over and over and reimporting just to discover another failure with the JSON import.

Here is an example of an issue I'm trying to import:

{ "key": "PROJ-4208", "externalId": "PROJ-4208", "summary": "Custom 404 page breaks", "description": "Description goes here", "creator": "User1", "reporter": "User1", "assignee": "User2", "issueType": "Bug", "status": "Done", "priority": "Unknown", "resolution": "Resolved", "created": "2013-06-18T13:57:09.000-0400", "updated": "2017-05-25T11:25:09.000-0400", "affectedVersions": [ "3.0.0.2 - Ares" ], "fixedVersions": [ "3.0.0.2 - Ares" ], "labels": [], "components": [ "WWW" ], "attachments": [], "comments": [], "customFieldValues": [ { "fieldName": "Dev Release Notes", "fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:textarea", "fieldValue": "Code was pointing to templates that didn't exist." }, { "fieldName": "Epic Link", "fieldType": "com.pyxis.greenhopper.jira:gh-epic-link", "fieldValue": "Bugs" }, { "fieldName": "Rank", "fieldType": "com.pyxis.greenhopper.jira:gh-lexo-rank", "fieldValue": "1|hyim6v:" }, { "fieldName": "Sprint", "fieldType": "com.pyxis.greenhopper.jira:gh-sprint", "fieldValue": [ "com.atlassian.greenhopper.service.sprint.Sprint@49bc9cb0[id=128,rapidViewId=<null>,state=CLOSED,name=Sprint 2 - 3.0.0.2 - Ares,startDate=2013-06-13T11:52:46.728-04:00,endDate=2013-06-26T16:52:46.728-04:00,completeDate=2013-06-28T14:37:57.925-04:00,sequence=128,goal=<null>]" ] } ]}

Here is the associated epic, which appears earlier in the JSON file:

{ "key": "PROJ-3422", "externalId": "PROJ-3422", "summary": "Bugs", "description": "Bugs", "creator": "User2", "reporter": "User2", "assignee": "User3", "issueType": "Epic", "status": "Done", "priority": "Unknown", "resolution": "Resolved", "created": "2013-01-28T13:07:25.000-0500", "updated": "2018-06-19T09:02:59.000-0400", "affectedVersions": [ "2.6.1.1" ], "fixedVersions": [ "noRLS" ], "labels": [], "components": [ "Legacy" ], "attachments": [], "comments": [], "customFieldValues": [ { "fieldName": "Dev Release Notes", "fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:textarea", "fieldValue": "-" }, { "fieldName": "Epic Name", "fieldType": "com.pyxis.greenhopper.jira:gh-epic-label", "fieldValue": "Bugs" }, { "fieldName": "Epic Color", "fieldType": "com.pyxis.greenhopper.jira:gh-epic-color", "fieldValue": "ghx-label-8" }, { "fieldName": "Epic Status", "fieldType": "com.pyxis.greenhopper.jira:gh-epic-status", "fieldValue": "Done" }, { "fieldName": "Rank", "fieldType": "com.pyxis.greenhopper.jira:gh-lexo-rank", "fieldValue": "1|hyfmcf:" } ]}

Previous research suggested that trying to use the issue key or the externalId (which in this case is the same as the issue key) would not work as a value for Epic Link, but that the Epic Name might. However, this proved to be false. None of the tickets we imported had Epic Links and all the Epics we imported have no issues attached. Furthermore, in the log, the only errors we can see regarding this issue are lots of the following:

2018-12-13 20:39:54,263 INFO - Ignoring empty [ null ] for CustomField Epic Link in Issue ‘Custom 404 page breaks’

This error appears even on issues that have Epic Links set in the JSON, as you can see above.

How do I get issues to import with the proper epics attached?

EDIT: Some further tests reveal that our Epics aren't importing properly. The issue gets created fine, but the Epic Name doesn't carry over. As shown in the JSON above, we are using the com.pyxis.greenhopper.jira:gh-epic-label as suggested in https://community.atlassian.com/t5/Questions/Is-it-possible-to-import-the-Epic-Name-field/qaq-p/162275

1 answer

1 vote
Chris Holman October 27, 2021

After decompiling the JSON importer JAR file, it seems that the EPIC must be referred to by its 'key' not its externalId i.e.

{ "fieldName": "Epic Link", "fieldType": "com.pyxis.greenhopper.jira:gh-epic-link", "fieldValue": "JIRA-1234" }

NOT:

{ "fieldName": "Epic Link", fieldType": "com.pyxis.greenhopper.jira:gh-epic-link", "fieldValue": "1234" }

Also, you need to first import the Epics, then import the remaining Issues with epic-links.
An autogenerated all-in-one JSON file could try to create an epic-link before the Epic exists. The import error will confusingly suggest "Probably value was in incorrect format".

Darren Houldsworth November 3, 2022

Note: It should be "value" and not "fieldValue".

 

"fieldName": "Epic Link",
"fieldType": "com.pyxis.greenhopper.jira:gh-epic-link",
"value": "JIRA-1234"

Suggest an answer

Log in or Sign up to answer