Hi,
I'm trying to retrieve a list of linked issues for a given issue key, using http://jira/rest/api/latest/issue/{key}
I'm getting an issue links array returned if I fetch a story, but not if I fetch a dev issue which is linked to that story.
It would appear that JIRA is only returning issue links from one side of the relationship, but I have looked at this previously and didn't think this was the case.
Is this correct? And if so, is there an easy way of including the issue links in the returned object, without a separate JQL search of "issue in issuelinks("{key}")" ?
JIRA version: v6.1.3#6158
Many thanks,
Simon
Community moderators have prevented the ability to post new answers.
There is one more way to do it. Try the /issue/{key}/remotelink endpoint, like https://ecosystem.atlassian.net/rest/api/2/issue/ACJIRA-884/remotelink.
Docs for 6.4: https://docs.atlassian.com/jira/REST/6.4.9/#d2e1131
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Life saver! This option helped me with retrieving the Wiki Page linked to the issue. Thanks!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The links are between all the other regular fields.
To use a publicly available JIRA instance as an example, have a look at: https://ecosystem.atlassian.net/rest/api/2/issue/ACJIRA-884. The response includes the following:
{ "key": "ACJIRA-884", "fields": { "issuelinks": [ { "id": "101800", "self": "https://ecosystem.atlassian.net/rest/api/2/issueLink/101800", "type": { "id": "10000", "name": "Relate", "inward": "is related to", "outward": "relates to", "self": "https://ecosystem.atlassian.net/rest/api/2/issueLinkType/10000" }, "outwardIssue": { "id": "196300", "key": "ACJIRA-1221", "self": "https://ecosystem.atlassian.net/rest/api/2/issue/196300", "fields": { "summary": "The {board.id} context parameter is empty in jira-projects-plugin:sidebar-panel location", "status": { "self": "https://ecosystem.atlassian.net/rest/api/2/status/1", "description": "", "iconUrl": "https://ecosystem.atlassian.net/images/icons/statuses/open.png", "name": "Open", "id": "1", "statusCategory": { "self": "https://ecosystem.atlassian.net/rest/api/2/statuscategory/2", "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "self": "https://ecosystem.atlassian.net/rest/api/2/priority/3", "iconUrl": "https://ecosystem.atlassian.net/images/icons/priorities/major.svg", "name": "Major", "id": "3" }, "issuetype": { "self": "https://ecosystem.atlassian.net/rest/api/2/issuetype/4", "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "iconUrl": "https://ecosystem.atlassian.net/secure/viewavatar?size=xsmall&avatarId=15310&avatarType=issuetype", "name": "Improvement", "subtask": false, "avatarId": 15310 } } } } ] } }
Similarly, if we check the linked issue, we'll see a reverse link: https://ecosystem.atlassian.net/rest/api/2/issue/ACJIRA-1221
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any solution to this? This issue is making my scripts useless...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you have the permission to see the links, on the account used for authentication on this request? That's the only possible explanation that comes to my mind right now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
At least I do. I see linked issues when watching the issue page, but the REST api does not return them under the same user, or even in the same browser. E.g.
https://wetrack.$company.com/rest/api/latest/issue/KEY-17356?fields=issuelinks
yields:
{
"expand": "renderedFields,names,schema,transitions,operations,editmeta,changelog",
"id": "990120",
"self": "https://wetrack.$company.com/rest/api/latest/issue/990120",
"key": "KEY-17356"
}
Without the 'fields=issuelinks' I get a lot of fields, but still no links.
It works as expected with the aforementioned https://ecosystem.atlassian.net/rest/api/2/issue/ACJIRA-884?fields=issuelinks
Mine is v6.4.12, ecosystem doesn't show a version?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is one more way to do it. Try the /issue/{key}/remotelink endpoint, like https://ecosystem.atlassian.net/rest/api/2/issue/ACJIRA-884/remotelink.
Docs for 6.4: https://docs.atlassian.com/jira/REST/6.4.9/#d2e1131
(sorry, posted it as a top-level answer first)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kudos for fast reaction, but remotelink is '[]' as well.
And on ACJIRA-884 internal issuelinks and /remotelinks are different - issuelinks point to other issues, and /remotelinks to confluence/other jira instance).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm out of ideas. remotelinks being cross-app makes sense.
You may have some luck asking Atlassian for support...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It turns out that issuelinks are present in the API for some projects (evem when the value is []), but not for all. So it seems to be a project setup thing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply. But my problem is I am not at all getting any information on the linked issues on a specific project issues even I try with https://JIRAURL/rest/api/latest/issue/ISSUENUMBER
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sanu - see my answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Konrad Garus - Sorry, then how could I find linked issue details?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sanu - it's buried in the fields. Not a top-level property, just another regular field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Konrad Garus - When I am trying with https://JIRAURL/rest/api/latest/issue/ISSUENUMBER?fields=issuelinks, getting output,
{code}
{
"expand": "renderedFields,names,schema,transitions,operations,editmeta,changelog",
"id": "904303",
"self": "https://JIRAURL/rest/api/latest/issue/904303",
"key": "ISSUENUMBER"}
{code}
Which is not having any info on remote link issue details. Here issue number is the one I mentioned on the rest call.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sanu - the links are available on the issues, as regular fields.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All - Did you able to get a solution for this issue? I am also facing similar issue. Please help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm having the same issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JIRA should return all links. Can you attach your request and response here ?
Also you might try adding ?fields=*all to the request URL, so all fields are returned.
https://docs.atlassian.com/software/jira/docs/api/REST/latest/#d2e3932
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Boris,
Request and response as follows (I've anonymised the names/descriptions etc, but replaced the two keys as PROJECT-1 and PROJECT-2). I also formatted the JSON for readability.
As you can see, PROJECT-2's response displays the issue links correctly, one of which is for PROJECT-1. But PROJECT-1 does not return any issue links at all.
Both requests were made with the format:
http://jira/rest/api/2/issue/PROJECT-1?fields=*all
(PROJECT-1 response.txt)
(PROJECT-2 response.txt)
Many thanks
Simon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.