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,556,502
Community Members
 
Community Events
184
Community Groups

how to equal jira api maxResults to total

would like know is it possible to have maxResults matching the total i'm pulling data from Jira using REST API, refer to screen shot below.

 

https://tools.standardbank.co.za/jira/rest/api/2/search?jql=%22Programme%20Increment%22=%222019/PI%20%234%22&expand=changelog&maxResults=100

 

maxR.png

2 answers

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.
Nov 07, 2019

@Mabutho_MncubeThe simple answer to this is you can't.

As per API documentation the maximum number of issue you can fetch from Jira using api is set to 1000. So that is the maximum limit.

To by-pass this issue, you have to call API multiple times with start index defined.

I'm not sure if you resolved this issue but I used the following code to accomplish a similar goal.

```

URL = "[JIRA HOST]/rest/api/2/search?jql=project=[KEY]&fields=attachment"
with
requests.get(URL, auth=HTTPBasicAuth(USERNAME, PASSWORD)) as content:
total = int(content.json()["total"])
max_results = total if total > 100 else 100
MAX_URL = "&".join([URL, f"maxResults={max_results}"])

(MAX_URL = https://[JIRA HOST]/rest/api/2/search?jql=project=[KEY]&fields=attachment&maxResults=4585)

```

@John Russell can you elaborate more on that code you pasted? I tried plugging it in and it didn't work

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events