Forums

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

Getting the User Id of an approver in Automation

Edward Moxley
Contributor
January 25, 2024

I am trying to update an asset "table" with the person that approved a request. The attribute in the Assets table is a User type field. I'm trying to get the user id of the approver and update that table. So far, it's been a bit maddening... I am able to get the Display name, but have not found anywhere (including the non-working Atlassian documentation) that explains how to get the user id and update the Asset record. I'm using this to get the Display Name, but not sure how to tweak it to return the User Id:

{{#issue.fields.Approvals.approvers.get(0)}}
{{#if(equals(approverDecision,"approved"))}}
{{approver.displayName}}
{{/}}
{{/}}

 

I've scoured this site, and found a question that was flagged as answered without a working answer.

 

Any help would be appreciated.

1 answer

1 accepted

0 votes
Answer accepted
Laurie Sciutti
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 25, 2024

Hi @Edward Moxley ~ maybe try this?  {{approver.accountId}}

Bill Sheboy
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 25, 2024

Hi @Edward Moxley 

Adding to Laurie's answer, here are the supported attributes for the user smart values:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-users/

Kind regards,
Bill

Like # people like this
Edward Moxley
Contributor
January 26, 2024

Laurie's answer was spot on. Now I need to get the date that the approval was provided. I tried {{approval.completedDate}} and it comes back as null.

 

Any ideas?

Bill Sheboy
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 26, 2024

What is the trigger for your rule?  That smart value appears to only be available with the Approval Completed trigger.

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--approval--

Suggest an answer

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

Atlassian Community Events