JSM Approvals by Email (with a work around)

One of my favorite (if not THE favorite) features that Atlassian has recently rolled out is the ability to do Approvals by Email within Jira Service Management (JSM). This was in response to a long outstanding feature request with many votes by users. The idea is that a JSM project workflow can trigger an email to be sent to Approvers on a ticket. This trigger typically occurs when the ticket moves into a status with a preconfigured Approval process attached to it.

screenshot3.png

In our simple JSM workflow above, the Approval is configured for the In Progress status. Meaning that when a ticket moves into that status, the JSM project will use the built in process to email the Approvers asking for an Approval to the ticket.

The new functionality now allows a project administrator to configure the JSM project to use one of a few security methods when the email is sent. My preference is the no need to sign in one. This means that the Approver will receive an email with just two choices – Approve or Decline.

screenshot4.png

The recipient of the email simply clicks on the Approve or Decline button in the email and the ticket transitions automatically to the status mapped in the workflow. In my example workflow above, Approve will result in the ticket moving to Done while Decline will cause the ticket to get Discarded.

With my security setting of no sign in, the ticket is automatically moved with no sign in to Jira required! This is great for Approvals needed by Senior Leadership, who might rarely sign into Jira or be familiar with moving around inside of tickets.

As mentioned in regards to the security settings (sign in required versus not required, etc.), you can see more guidance here: https://support.atlassian.com/jira-service-management-cloud/docs/manage-settings-for-approval-by-email/

Now that’s all well and dandy, but some folks are having a slight struggle. I can’t actually modify the email text that is sent to include custom field information. So, can I really make a decision to approve the ticket by email without knowing key information about the request?

Most of us probably fall in that category. And, thankfully, there is an open request in the JAC to have the “Ability To Add Custom Field Values to Service Desk Notification Template”. Here is the link for more information (and you can vote!): https://jira.atlassian.com/browse/JSDCLOUD-4642

Until a fix is provided, what can I do? Well, here is a work around that I have used while waiting for the initial Approval by Email option to become a reality. This process is produced by using Automation For Jira.

First is an Automation rule created based on the ticket transition from one status to another. Another rule I use is based on a new ticket created in the JSM project. So there is flexibility in the actual rule trigger. The full rule looks like this:

screenshot1.png

One of the drivers of using this approach is that I can include custom fields in my email body along with HTML code to produce the Approve and Decline buttons.

Here is the actual code/text in one of the emails I send:

{{issue.reporter.displayName}} has raised an issue.

<a href="{{issue.toUrl}}">{{issue.summary}}</a>

Additional Details: {{issue.description}}

<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="0">

<tr>

<td height="21" align="center" bgcolor="#068000" style="-webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px;"><a href="mailto:jira@yourdomain.atlassian.net?subject=Re: {{issue.key}} Issue&body=I approve this ticket" target="_blank" style="font-size: 18px; font-family: Arial, sans-serif; color: #ffffff; text-decoration: none; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; padding: 10px 25px; border: 1px solid #068000; display: inline-block;"><!--[if mso]>&nbsp;&nbsp;<![endif]-->Approve<!--[if mso]>&nbsp;&nbsp;<![endif]--></a></td>

<td align="right" style="padding-left: 5px; padding-right: 5px;"></td>

<td height="21" align="center" bgcolor="#FD1B00" style="-webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px;"><a href="mailto:jira@youdromain.atlassian.net?subject=Re: {{issue.key}} Issue&body=I decline to approve" target="_blank" style="font-size: 18px; font-family: Arial, sans-serif; color: #ffffff; text-decoration: none; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; padding: 10px 25px; border: 1px solid #FD1B00; display: inline-block;"><!--[if mso]>&nbsp;&nbsp;<![endif]-->Decline<!--[if mso]>&nbsp;&nbsp;<![endif]--></a></td>

</tr>

</table>

Be sure to change the yourdomain to your actual value. 

Feel free to modify as you desire. This will produce an email similar to the built in JSM one above, but it includes some additional text and fields that I want to convey to the receiver of the email.

Finally, a second rule is created to cause the ticket to transition as an Approval when the user clicks on the Approve button in the email. Before I post that, I must include a VERY IMPORTANT NOTE. When the user clicks on the Approve (or Decline) button in the email, it will actually open a response email. The user at this point simply clicks send. Another caveat is that this this the process uses MS Outlook – I have not tried it with email tools such as GMAIL, Yahoo, etc.

You will also notice that the response email simply has a line that reads “I approve this ticket”. Again, the user should simply click Send and not change the text of the email. You can change that text to be whatever you like in the original email – notice in my sample code above where those words "I approve this ticket" are included and simply replace with your own wording.

The sending of the email will cause a comment to be added to the ticket as is normal Jira practice if you reply to an email sent from Jira.

Here’s the final Automation rule:

screenshot2.png

This rule will trigger when a comment is added to the ticket. We just saw above that the send of the response email will cause this comment to be added.

The If: matches condition checks for those key words associated with the Approve button of the email. When it sees those, it executes the action of an Approve of the request (an Automation new action option).

The result? The card is Approved in the system!

A final note -  I have created different rules for each JSM project to give maximum flexibility to my email text as well as reducing the number of multiple project or global Automation rule executions that take place in order to not exceed your allotment of executions for the month. It’s a simple and quick process to create the initial two rules and then copy and change for additional projects.

So let’s recap that last part in simple terms, assuming your Automation rules are in place.

  1. Some type of trigger will happen to cause your rule to be executed.
  2. The result will be that an email is sent to the Approvers on the ticket
  3. The user receiving the email will click on the Approve or Decline button, which will open a response email.
  4. The user simply clicks Send.

Please feel free to suggest changes to this process or post other solutions you may have used. My hope is that this helps make you and your team/organization a little more productive!

16 comments

Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2021

Great article.  Thanks for all the details.

Like John Funk likes this
Stephan Thiele May 5, 2022

It is an very good article and helpful, but i have a question about the mail adress in the body --> 

<a href="mailto:jira@yourdomain.atlassian.net?subject=Re:

i think this is an example mail, which particular mail adress do i have to insert here ?

John Funk
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 1, 2022

Hi Stephan - yes that should be more generic @yourdomain.atlassian.net where you replace with your own specific domain name. I have edited your message to remove the proprietary name. 

Let me know how it works for you!

Like Jessica Munoz Valerio likes this
Manas Bagde August 3, 2022

@John Funk This is great. I have used it with schedule trigger to send 1st and 2nd level escalation emails. Working fine for me.

Thanks.

Like # people like this
Manas Bagde August 3, 2022

@John Funk is there a way to add email body text in multi color? Tried multiple things but href="mailto is not accepting html tags within the double quotes.

Ex: body=I approve this ticket (DO NOT CHANGE THIS TEXT)

I would like to add (DO NOT CHANGE THIS TEXT) text in RED color

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 3, 2022

Hi @Manas Bagde  - I am not an HTML expert, so I am afraid I would not be much help there. Maybe try some other sources with those skills? 

Like Manas Bagde likes this
Chris Lynch October 13, 2022

Hi,

I believe this is a better approach for including custom fields as you still use the Approvals notification which includes the buttons.

My work around for this is as follows.

  1. Create a new Custom Field for Description. Set it render to Wiki Style
  2. Add this to the Request and Issue View of you Change Requests
  3. Remove the System Description
  4. Using Jira Automation populate the System Description with all the fields you need to include in the Email.
    1. For Example, I'm populating with custom Versions, Affected  Services, Start Time, etc.
      {{issue.Custom Field}}
  5. In the Default Customer Notifications
    1. Update the Approval Email to include ${issue.description}

Now when Approval is required I can include all information I need and adjust the information set in the System Description based on any other information. Software change would include different information to Infrastructure or Environment change requests..

If needed you can export all your issues, and import again to update the new Description field with information from the System Description before you enable the new Automatation.

 

Like # people like this
Boris Berenberg - Modus Create October 25, 2022

We recently added support for Jira Service Management approvals in Notification Assistant for Jira where we also support full customization of the email template. If you have any questions, feel free to open a support ticket at https://atlasauthority.atlassian.net/servicedesk/customer/portal/1/group/1/create/1

Ali Aydın December 27, 2022

@John Funk 

Hello,
I implemented the solution, but when I send approval, Ali Aydın
Ali Aydın (No Response) I am getting No Response error and the transaction is not executed.
Can you assist?

Regardsno response.JPG

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 28, 2022

@Ali Aydın - Your screenshot says the Status approved

Ali Aydın January 2, 2023

Hi @John Funk  

"Approved" not set ,When I check I see that it is waiting for pending.

Regards

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2023

@Ali Aydın - Did your automation rule fire? And if so, what did the Audit Log say?

Vinci Louise Morales August 30, 2023

is it possible to edit the color of the approval button sent in the email? 

Like John Funk likes this
Gene Sullivant October 3, 2023

@John Funk 

We love your solution and have used if for almost a year. We used Comments as the trigger for the Replies which works but with the restrictive Automation counts coming in to play we have to make a change. I am suggesting to my Mgr we use the Transition solution.

Are there any other Triggers that would be useful? Are there any Triggers in development that might allow us to be specific i.e. "I approve this MSR" vs Comment as a main action?

Thanks! 

Like John Funk likes this
Jessica Munoz Valerio January 29, 2024

Hello guys, 

 

Thank you for this solutions John's solutions seem to work great. However, I am facing a problem when I want to add more to the "Additional Details" I would like to include more Custom fields that I created when people submit a ticket. 

Example:

Additional Details: {{issue.description}} I want to add {{issue. Software Request}} or {{issue.Software Cost}}

Any suggestions on how I can do this? 

 

@John Funk @Chris Lynch

 

Thank you In advance guys

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 7, 2024

Hi @Jessica Munoz Valerio  - Do it just like you have it. Assuming Software Request and Software Cost are the exact names of the fields. 

Like Jessica Munoz Valerio likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events