How do I get the user info from a tempo worklog?

Afonso Souza
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 30, 2024

How do I get the name of the Jira account that created the Tempo worklog? Using the 

https://apidocs.tempo.io/ I can only get the author accountId, which is an account of Tempo.

 

 

3 answers

1 accepted

4 votes
Answer accepted
Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 30, 2024

Hi @Afonso Souza 

After getting the author.accountId field in the Tempo API response, you can use the Jira REST API to retrieve user details based on this Account ID.

The endpoint for this is:

GET https://your-domain.atlassian.net/rest/api/3/user?accountId=<author.accountId>

You can get user display name, avatar, etc using this endpoint.

0 votes
Salih Tuç
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.
October 30, 2024

Hi @Afonso Souza , welcome to the Community!

Yes, Tempo worklog is just returning account id. So, you should combine it with Jira Cloud's Get User method:

curl --request GET \
  --url 'https://your-domain.atlassian.net/rest/api/3/user?accountId=<account_id_from_tempo>' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

With this way, you can access the user's details like displayName, emailAddress and more.

0 votes
Salih Tuç
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.
October 30, 2024

Hi @Afonso Souza , welcome to the Community!

You are on the right way. Yes, Tempo is just returning account id in the worklog. So, you should combine it with Jira Cloud's Get User method:

curl --request GET \
  --url 'https://your-domain.atlassian.net/rest/api/3/user?accountId=account_id_that_returns_from_tempo>' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

With this way, you will get details about this user.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events