Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Tempo REST API - Worklogs - How to retrieve the latest worklog author.

Rekhadevi Velur September 9, 2021

I need to write an automation rule based on the user who logged the work. I have Tempo Timesheets enabled on my Jira software cloud.

I am calling the Tempo REST APIs https://api.tempo.io/core/3/worklogs/issue/{{issue.key}} which returns all work logs on this issue. 

I need the latest author from the response. So I thought I can get that information if I can call Jira REST APIs like https://<my Jira cloud  URL>/rest/api/2/user/accountId={{webResponse.body.results.author.first.accountId)}}

Then I realized the accountId is a list and I am not sure how to get only the latest worklog entry from the {{webResponse}} and the respective accountId to pass it to Jira REST API.

Is there a way to get the user who triggered the worklog from Tempo or Jira REST APIs?

 

Thanks

 

1 answer

1 accepted

0 votes
Answer accepted
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 9, 2021

Hi @Rekhadevi Velur ,

welcome to the Atlassian Community!

I don't have any exact solution, but I just wanted to share some ideas with you.

Are you aware there's "Work logged" trigger in automation? Then you can work with {{worklog}} smart value. It is not possible to use {{worklog.author.accountId}} as this is Tempo user, but maybe you can use {{worklog.id}} to get the detail of the exact worklog using REST API?

Rekhadevi Velur September 9, 2021

Thanks for your Reply!

I am able to retrieve the author calling Tempo REST API using 
{{worklog.id}} in the web request action. The URL would be  

"https://api.tempo.io/core/3/worklogs/jira/{{worklog.id}}"

and then retrieved the author from the response using the smart value

{{webResponses.body.author.accountId}}

Like Hana Kučerová likes this
Martin Kovalcik
Contributor
October 9, 2023

I can successfully log {{webResponse.body.author.displayName}} or {{webResponses.body.author.accountId}} to rule's audit log, but I am unable to send email to {{webResponse.body.author.displayName}}'s email address.

 

I get error

"Send email
Could not send email, the 'To' address field is empty. If you have referenced a field it may be empty."

 

please help

Suggest an answer

Log in or Sign up to answer