Forums

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

Issue with Tempo REST API 4 version

Praveen June 27, 2024

Hello ,  

 

I am trying to create the worklog in tempo using the API. I followed this tempo documentation 

https://apidocs.tempo.io/#tag/Worklogs/operation/createWorklog. As per the documentation it say issueId is an Integer but in our project (JIRA Number) is an Alpha numeric( Example: ABC-1234). So when i run the post command using python i am getting the 400 response. How can i resolve this issue ?

 

Base url for request: 'https://api.tempo.io/4/worklogs'

payload = {
"authorAccountId": "123456789",
"billableSeconds": 3600,
"description": 'TEST',
"remainingEstimateSeconds": 120,
"startDate": '2024-06-26',
"startTime": "08:00:00",
"timeSpentSeconds": 3600
}

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
Susanne
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 27, 2024

Hi @Praveen

As mentioned in the REST API documentation you are referring to, the issueId is required. This id is always an Integer and should not be confused with the Issue key (which can be alpa numeric).

The Issue Id can be found by making a REST Call to JIRA
GET  /rest/api/3/issue/{issueIdOrKey}
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get

or by creating an XML export of the issue (click the "..." at the top of the right sidebar (Action) and select Export XML.  In the xml file, you should see an entry similar to 

<key id="20042">ABC-1234</key>  

and the 20042 is the issue id you need for the Tempo REST call. 

Best regards,
Susanne 

TAGS
AUG Leaders

Atlassian Community Events