Using {{approval.approver.displayName}} does not work in Automation

Rodolfo Romero - Adaptavist June 17, 2022

I'm working on an Automation rule that will send an email to the approvers when the ticket approval process has been completed. All smart values are properly calculated, except for {{approval.approver.displayName}} which should give me the display name of the person who approved the change.

Based on the documentation, {{approval.approver}} should give you the user id of the person who approved the change and it is mentioned that user smart values can be combined with this so I assumed that adding ".displayName" would do the trick but when the email is sent that value shows empty.

Here is the structure of the email I'm sending:

{{approval.approver.displayName}} has completed the approval on {{approval.completedDate}} with {{approval.decision}} decision for {{issue.key}}.

*** Approvals status: ***
{{#issue.Approvals}}
{{#approvers}}
Name: {{approver.displayName}} - Action: {{approverDecision}}
{{/}}
{{/}}

 

Any thoughts?

2 answers

1 accepted

1 vote
Answer accepted
James Navin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 26, 2022

Hi @Rodolfo Romero - Adaptavist ,

Thanks for raising this issue. It looks like you've stumbled across a bug. The `{{approval.approver}}` is actually currently being rendered as a plain `String`, rather than as a `User` object and hence won't work for your use case.

I have raised https://codebarrel.atlassian.net/browse/AUT-2414 to address the problem. Will hopefully be able to fix it soon.

Cheers,

James

Rodolfo Romero - Adaptavist June 28, 2022

Hi James,

I can confirm that this has been fixed and deployed to Cloud.

Thanks!

Rodolfo

Clemens Fischer July 13, 2022

Hi @James Navin ,

unfortunately I don't seem to make it work. I have a workflow configured where the status of the workflow is transitioned from "Warte auf Genehmigung" (waiting for approval) to "In Arbeit" (in progress).

Once the approval is complete, I want to inform the IT department, that the issue has been approved and can be worked on now.

This is how my Automation rule looks: Jira_Automation.png

The email looks like this:

Die Hardwareanforderung <a href="{{issue.url}}">{{issue.key}}: {{issue.summary}}</a> wurde genehmigt durch {{approval.approver.displayName}}.

 

Now whenever there is an email, the text just looks like this:

Jira_automation_mail.png

I am on Jira Cloud and supposedly the latest version. Would appreciate any help.

 

Thanks!

Clemens

Rodolfo Romero - Adaptavist July 14, 2022

@Clemens Fischer are you using Jira Service Management and configuring your workflow to do approvals? This is required to make this work.

Clemens Fischer July 14, 2022

@Rodolfo Romero - Adaptavist The workflow has an approval step which is the transition from "Warte auf Genehmigung" to "In Arbeit". So whenever the approval is triggered and the workflow transitions to "In Arbeit", the rule is executed.

Is there another way to do it?

Rodolfo Romero - Adaptavist July 14, 2022

@Clemens Fischer a few things are needed for this to work.

  1. Your project needs to be a Jira Service Management project. This does not work in a Software project.
  2. The status in the workflow needs to have the "Include approval step" checked.
    2022-07-14_17-13-38.png
  3. The approval process needs to be configured.
    2022-07-14_17-17-07.png2022-07-14_17-17-32.png

After this is done, the values in the {{approval.approver.displayName}} will be available.

Clemens Fischer July 14, 2022

Hi @Rodolfo Romero - Adaptavist

thanks for getting back to me. I have everything configured as you have shown, however it is still not working.

The return value for {{approval.approver}} is an empty string, so {{approval.approver.displayName}} naturally does not work as well. Debugging this is rather tricky, because the audit log for the automation rule does not provide further information.

Maybe the fix is not live yet in the Cloud version that I am using. But that really does not make any sense.

Like Mehdi Mohammad Ali likes this
robert.davenport
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!
August 22, 2023

@Clemens Fischer  , you might have figured this out already.  I would check to make sure the ticket has a request type associated to it.  Approval behaviors appear to be tied to a request type or visibility through the portal.

0 votes
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 17, 2022

what if you test w/o DisplayName then check if it is giving the correct accountID? Just trying to dissect the problem to find the broken bit. You might use the log action to record {{approval.approver.displayName}}  as well. 

Rodolfo Romero - Adaptavist June 20, 2022

Without "displayName" it provides the account ID.

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 20, 2022

ok that is good to know. if you use log action with 

{{approval.approver.displayName}}

what is logged? 

Anil Jassi June 22, 2022

I have the exact same problem, I'm trying to use Automation to work out who is the approver in a request with multiple approvers, then send an email which includes the name of the person who approved the request.

The following shows all possible approvers which is what I do not require.

{{issue.Approvers.displayName}}

 

The following is blank, logging it only returns 'Log'

{{approval.approver.displayName}}

 

Like Mehdi Mohammad Ali likes this

Suggest an answer

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

Atlassian Community Events