Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,979
Community Members
 
Community Events
184
Community Groups

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
DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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
AUG Leaders

Atlassian Community Events