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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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

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.
Sep 09, 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?

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

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
TAGS
AUG Leaders

Atlassian Community Events