How to get approval status for worklogs using TEMPO Rest API?

HSNAN January 3, 2019

I am trying to get approval status for worklogs using the parameter "addApprovalStatus=true" via TEMPO Rest API but nothing is returned by the API. Is there any level of permission required to view approval statuses for worklogs?. I do not have team administrator or manager permission. Is it possible to get approval status via API without these permissions?. Any help or suggestions would be appreciated!

3 answers

1 accepted

1 vote
Answer accepted
Jan
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.
January 4, 2019

Are you wanting to pull the status of all timesheets (like who has submitted, pending approval and approved)?

Use this api https://jira.companydomain.com/rest/tempo-timesheets/4/timesheet-approval?teamId=00&periodStartDate=2018-07-15     where companydomain is your company details and teamId will need to be set to the number for the team. It will only retrieve one week at a time if you are on weekly approvals, so you'll have to run it for each week. It returns the data in JSON format but you can use a free json to csv converter online to export to excel.

HSNAN January 9, 2019

Thanks Jane. This would help me for now. Is there any way where i can get the approvals every month instead of week? 

Jeffrey Schumacher February 4, 2019

Hi Jane, where is the most recent documentation for the above api? The above link works great in my environment but does not match the documentation I could find. The documentation also only includes the username parameter not teamId as above. I'm actually trying to make the username parameter work and I can't! 

Jan
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 19, 2019

@HSNAN - Tempo says it should return based on the period configurations you have set in Tempo Settings (Monthly, Weekly). But, I have not had success in pulling it for an entire month. I've only ever received one week at a time. 

@Jeffrey Schumacher https://www.tempo.io/developers - On this page you can then navigate to cloud or server. Then drill down into what you need. I haven't tried it with username but I "think" you would need to know the teamid the user is a member of.

0 votes
Ferenc Nagy June 11, 2021

In case of Jira Server/Data Center, you cannot get the approval status of the worklogs directly by using the Tempo REST API, however it's possible with the Tempo Servlet API.

https://www.tempo.io/server-api-documentation/servlet

https://tempo-io.atlassian.net/wiki/spaces/THC/pages/366805324/Tempo+Servlet+Manual

0 votes
Warren
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.
January 3, 2019

I'm not totally sure of the answer, but something I have read numerous times is that the permissions required via the API are exactly the same as it is within Jira. So ... if you are unable to do this in Jira itself, you will not be able to do it using the API.

 

Hope this helps a bit.

Suggest an answer

Log in or Sign up to answer