Forums

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

jira rest api http request

sangam kumar May 21, 2019

Hi,

I have developed a python plugin for Jira  integrated with Splunk which pulls all the detailed info of jira tickets including fix version and remorelink. I have used  /rest/api/2/search?jql=project='ABC'%20order%20by%20updated%20desc&expand=changelog,versionedRepresentations&fields=timeoriginalestimate,summary,subtasks,reporter,customfield_12094,timetracking,status,assignee,project,aggregatetimespent,issuelinks,worklog,issuetype,environment,creator,customfield_10006,progress,fixVersions,priority,created,description,aggregatetimeoriginalestimate,updated,customfield_10005,customfield_10007,resolution,customfield_10008,duedate,resolutiondate&maxResults=50

I have around 5000 tickets and it pulls using pagination i.e 50 in each API request. Each ticket will go trough 2 more API i.e. one for FixVersion and one for Remote Link.
But after sometime i am seeing that my script is failing and in logs i can see that
HTTP Request error 401 Client Error: while calling the above url at some point of  after calling all the pagination one by one.

Is there any limit to hit the no. of API request in particular span of time??
Can we increase the load capacity of our Jira to take more requests.

 

Thanks,
Sangam

 

2 answers

1 accepted

0 votes
Answer accepted
Alexey Matveev
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.
May 21, 2019

Hello,

There are no limits on Jira Rest Api. 

How do you authenticate? 

sangam kumar May 21, 2019

Using Basic authentication  with my service credentials. Most of the time it returns the value but randomly in between it breaks.

Alexey Matveev
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.
May 21, 2019

Try to catch the exception and execute the rest call again. There are no limits. I never had a problem like you with Jira Cloud Rest Api

sangam kumar May 23, 2019

Yeah finally i have to put while loop while hitting the API where if i get 401 error then go  and hit the API again and again till not getting 200 status.
It worked for me this way. But someone needs to look onto this. This is happening for our jira cloud.  I tested for others it didnt happen. May be because of we have lots of projects and we have scheduled the script to run every 5 mins.

Alexey Matveev
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.
May 23, 2019

You can create an issue at https://getsupport.atlassian.com

Like sangam kumar likes this
sangam kumar May 23, 2019

@Alexey Matveev Thanks mate :) 

Alexey Matveev
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.
May 23, 2019

You are most welcome!

0 votes
Gonchik Tsymzhitov
Community Champion
May 22, 2019

I hope  the problem related the basec auth, because this morning my scripts with basic was corrupted L:(*

sangam kumar May 23, 2019

Dont know but the same scripts work for the other time and its behaving weird by giving randomly  401 .

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events