Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle x-ratelimit-fillrate

Vishal Biyani
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.
February 6, 2024

I need to update about 100,000 issues due to addition of a custom field.

I am using python jira library. the code ran for some time and now i am getting error

KeyError: 'x-ratelimit-fillrate'

 

Since i was not sure how to get header values when i am getting this error from jira client, I ran similar code with jira rest api's using pyhon.

 

I see the response header has values like

"X-Ratelimit-Limit": "300000"

"X-Ratelimit-Remaining": "0",

"X-Ratelimit-Reset": "2024-02-07T07:40Z",

"Retry-After": "243",

I need guidance in terms of how to ensure i don't hit "X-Ratelimit-Remaining": "0", and complete my task of updating so many issues

.

1 answer

0 votes
Charlie Misonne
Community Champion
February 7, 2024

Hi @Vishal Biyani

Here is some documentation about rate limiting on Jira Cloud. You are on Cloud right?
That page shows you a code example of how to handle the headers and retry when you hit the limit.

When you hit "X-Ratelimit-Remaining": "0" or the Retry-After header is present you should wait that amount of seconds before executing a request again (243s in your example). 

To my surprise the headers you mention are not all described on that page and are better explained on the Data Center documentation. If I'm not mistaken X-Ratelimit-Limit tells you how many request you can do in 5 minutes.

Vishal Biyani
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.
February 7, 2024

Thanks @Charlie Misonne 

is there anyway to find out what the current value of X-Ratelimit-Remaining?

when i print(session.headers) not getting this value till failure?

Charlie Misonne
Community Champion
February 7, 2024

Hi Vishal,

I'm note sure.

Do you see this one?: X-RateLimit-NearLimit indicates that less than 20% of any budget remains.

Vishal Biyani
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.
February 7, 2024

@Charlie Misonne 

Based on the response on stackflow thread, looks like rate limiting values come only when we hit error Code 429

 

how to get rate limit values in JIRA REST API of /rest/api/3/field 

Like Charlie Misonne likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events