JIRA Import Issue Links using JSON importer

Hello,

I am trying to test JSON importer for the links or issuelinks using the following JSON data structure. But I don't know what do "sourceId" and "destinationId" mean? Are they the issue numbers? How does it work for cross projects? What are the valid values for "name"?

"links": [
{
"name": "sub-task-link",
"sourceId": "2",
"destinationId": "1"
},
{
"name": "Duplicate",
"sourceId": "3",
"destinationId": "2"
}
]

Your help is much appreciated.

1 answer

1 accepted

This widget could not be displayed.

sourceID and destinationID refer to the issues being linked to each other. The number used to represent the issues being linked corresponds to the externalID. For instance, in your first example, the issue with externalID = '2' is the subtask (source) of the issue with externalID = '1' (the parent issue). This key is unique, and should allow you to link any issues together (even across projects).

//subtask
{
    "status" : "Open",
    "reporter" : "bob",
    "issueType": "Sub-task",
    "created" : "P-3D",
    "updated" : "P-1D",
    "summary" : "Sub-task",
    "externalId": "2"
}
//parent
                {
                    "priority" : "Major",
                    "description" : "Some nice description here\nMaybe _italics_ or *bold*?",
                    "status" : "Closed",
                    "reporter" : "alice",
                    "labels" : [ "impossible", "to", "test" ],
                    "watchers" : [ "bob" ],
                    "issueType" : "Bug",
                    "resolution" : "Resolved",
                    "created" : "2012-08-31T17:59:02.161+0100",
                    "updated" : "P-1D",
                    "affectedVersions" : [ "1.0" ],
                    "summary" : "My chore for today",
                    "assignee" : "bob",
                    "fixedVersions" : [ "1.0", "2.0" ],
                    "components" : ["Component", "AnotherComponent"],
                    "externalId" : "1"
                }

The "name" field corresponds to the types of links you can make (i.e. sub-task-link, Duplicate, Blocks, Incorporates, etc.)

Hope this helps!

Is it possible to link issues together using non-numeric, or alpha-numeric keys? 

For example: 

"links": [
{
"name": "sub-task-link",
"sourceId": "A",
"destinationId": "B"
},

 

//subtask
{
    "status" "Open",
    "reporter" "bob",
    "issueType""Sub-task",
    "created" "P-3D",
    "updated" "P-1D",
    "summary" "Sub-task",
    "externalId""A"
}
//parent
                {
                    "priority" "Major",
                    "description" "Some nice description here\nMaybe _italics_ or *bold*?",
                    "status" "Closed",
                    "reporter" "alice",
                    "labels" : [ "impossible""to""test" ],
                    "watchers" : [ "bob" ],
                    "issueType" "Bug",
                    "resolution" "Resolved",
                    "created" "2012-08-31T17:59:02.161+0100",
                    "updated" "P-1D",
                    "affectedVersions" : [ "1.0" ],
                    "summary" "My chore for today",
                    "assignee" "bob",
                    "fixedVersions" : [ "1.0""2.0" ],
                    "components" : ["Component""AnotherComponent"],
                    "externalId" "B"
                }

 

I believe the externalID is an ID internal to JIRA, and will not work in the way you are describing. You can certainly make REST requests to recover each of these IDs but they are always returned as a numeric value.

I want to use a JSON export file to copy the full project content between two JIRA instances. The problem is that the issue links are not contained neither in a JSON export nor in a CSV export.

Is it really necessary to add the issue links manually and this data cannot be directly received from the source database (assuming the issue keys are equal on both sides)?

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 Wednesday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

142 views 16 7
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