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?
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
Hi James,
I can confirm that this has been fixed and deployed to Cloud.
Thanks!
Rodolfo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
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:
I am on Jira Cloud and supposedly the latest version. Would appreciate any help.
Thanks!
Clemens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Clemens Fischer are you using Jira Service Management and configuring your workflow to do approvals? This is required to make this work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Clemens Fischer a few things are needed for this to work.
After this is done, the values in the {{approval.approver.displayName}} will be available.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Without "displayName" it provides the account ID.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok that is good to know. if you use log action with
{{approval.approver.displayName}}
what is logged?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.