Forums

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

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 Champion
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