Configuring fields inside "issuelinks"

Anton Pozhidaev March 26, 2019

I'm making the next API request

https://host.com/rest/api/latest/search?jql=some-jql&fields=issuelinks

In the response, I have something like

"issuelinks": [
  {
    ...
    "type": {
      "id": "123",
      "name": "Relates",
      "inward": "relates",
      "outward": "relates to",
      "self": "..."
    },
    "inwardIssue": {
      "key": "KEY-123",
      "self": "...",
      "fields": {
        "summary": "Ticket summary",
        "field1": "some_other_field"
      }
    }
  }
]

 How can I control "fields" inside "issuelinks"? For example I want to display more fields. I know how to do it in the tickets returned by search, but not for tickets inside "issuelinks"

Thanks in advance

2 answers

1 accepted

0 votes
Answer accepted
Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 27, 2019

Hi @Anton Pozhidaev 

I'm fairly sure that you can't control what appears within issuelinks.

issuelinks is the highest level field and it will return whatever it believes is it's full structure. Having said that, I would have imagined that it would contain everything that you need, I'm surprised you want more detail

Anton Pozhidaev March 27, 2019

Hi @Warren ,

Thanks for the answer. I think you are right that there is no way to accomplish what I want. I just wanted to be sure. 

The content of issuelinks is far from full and it is understandable as returning all fields of all tickets will be a performance concern. For example, in my Jira installation, there are a lot of custom fields, but they are not displayed on the ticket that is inside of issuelinks. For tickets inside issuelinks only summary, status, priority, issuetype are displayed. It is not even all not custom fields... 

Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 27, 2019

Hi @Anton Pozhidaev 

Surely you can get what you want from a 2 step approach?

Step 1

Run the query as you've given above, getting the issuelinks

Step 2

For each item within the issuelinks, get the KEY, then run another query to get all those fields for the given KEY

Anton Pozhidaev March 27, 2019

Yep, that's how I'm doing it... but it takes jira too long to process all requests... 

if we assume that each request from step 1 and step 2  takes the same time and the first request returns N tickets (with 1 issuelink each) then complexity changes from O(1) to O(N)... that is the main downside... 

Like Kin likes this
0 votes
Kin August 18, 2020

Also tried the async two step approach.

Step 1 is a single JQL to get issues based on your prefs  but the huge problem is the amount of queries in step 2 fired for each issue (id) to get ie. fields.fixVersions which can take some time. Not a great user experience and bad practice from an rest api point of view.

Suggest an answer

Log in or Sign up to answer