Forums

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

Does Jira Rest API have idempotent create Jira ticket API?

xdd1874
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 6, 2023

My system integrates Jira. When the user calls my API, because the response of create jira is too slow, I set a timeout period. If this time is exceeded, I will return an error, but the Jira ticket will be created successfully, and the user will be sent again Calling my API will create multiple Jira tickets. I am thinking, does Jira have an idempotent creation API? I call it many times and still only create one. I need this function.

1 answer

0 votes
Radek Dostál
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.
June 6, 2023

The first question I have is why do you implement a custom/different timeout than the endpoint? What is the logical reason to do that?

Second, why would the issue creation need a custom timeout to begin with, isn't it more suspicious for it to take "that" long (no idea how long)?

Third, no, you're not creating an issue by issue key, you're creating an issue with issue details. To prevent creating a duplicate, you would need to perform a lookup for the issue (e.g. JQL search, but this is risky and prone to fail in case of multiple nodes, if your indexes are lagging behind), alternative could be w/ java API if you had created a custom endpoint. Then, you could potentially do a fully cluster-safe implementation, but that would be one hell of a ride if we are talking about a full "idempotence" - multiple clients/requests trying to create an issue simultaneously since you only would want a single one of those requests to go through, while the others are waiting for the first one's result. I mean, that sounds like such a whiff for something which should not be needed in the first place.

I don't have an idea why you would decide to implement a lower/custom timeout from the original endpoint, when you are just forwarding the request to it, but that sounds like the cause to me here.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events