It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Hi,

I am using Jira APIs (https://ict4dprojectservices.atlassian.net/rest/api/2/search?jql=) to get information out of the system and have the following questions.

1. Max result set size is 100, how can I increase the size.

2. I am not able to get comments related to issues, using APIs.

3. How can I get the attachments for the issues?

Thanks,

Vipin 

 

1 answer

1 accepted

0 votes
Answer accepted
DPK_J Community Leader Feb 10, 2020

@vipin.gupta  Welcome to the community!

Here is answer as per your question,

  1. Max Result for JQL issue search API can't be more than 100 (it is max set by Atlassian), so if you want to fetch more data, you need to use startAt in combination with maxResults parameter.
  2. To get comments, you need to pass parameter named 'fields' with value 'comments'.
    • fields=comment&fields=summary
  3. Similar to comments you can also add attachment to fields,
    • fields=comment&fields=attachment

Thank you for the prompt reply, very useful.

Another question regarding startAt parameter.

I am using URL

https://ict4dprojectservices.atlassian.net/rest/api/2/search?jql=order%20by%20created%20DESC&maxResults=100&startAt=0&fields=comment&fields=attachment&fields=summary

I am getting below message.

Start At 0.jpg

This means I am getting 498 issues. So when I will set startAt parameter as 5, I should get empty response. But that is not the case, I am getting data with startAt parameter as 5

https://ict4dprojectservices.atlassian.net/rest/api/2/search?jql=order%20by%20created%20DESC&maxResults=100&startAt=5&fields=comment&fields=attachment&fields=summary

Please advice how to use startAt parameter so that code can end the loop.

Thanks,

Vipin

DPK_J Community Leader Feb 10, 2020

'total' in response here means total number of issue that your query satisfy.

So, for maxResults=100&startAt=0 query your response,

  • Here you are getting first 100 issues (starting from 0) out of total 498 issues

for maxResults=100&startAt=5

  • Here you will get 100 issues out of total 498 starting from 5th issue

You can take 'total' as maximum size of array and 'startAt' as starting index from where you are fetching sub array.

Thanks DPK. This is so helpful.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence Cloud

Convert your old pages to the new editor

Hey Community 👋, Following the recent release of the new editor, we will be releasing the ability for users to convert existing pages from the legacy editor to the new editor. We’ve been resp...

6,648 views 44 29
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you