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.
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.
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:
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]> <![endif]-->Approve<!--[if mso]> <![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]> <![endif]-->Decline<!--[if mso]> <![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:
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.
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!
John Funk
Jira Systems Administrator
ProVision Systems
Dubai, UAE
3,206 accepted answers
22 comments