Add Issue Operation Links to the Email

SINCE VERSION 6.1

Email this issue allows you to include issue operation links in the email body. All you need to do is to select Operation Links in the Field Picker dropdown in the email template editor.

Important note on Form Token Handling is below, please read it before you add operation links to emails.

 

Then add a placeholder in your email template to include the operation links:

How Links are Rendered

When you include the above mentioned template fragments, Email This Issue will use the below blocks of template code to render the operation links. If you want to customize how operation links are rendered, change layout or styles, include the below code block directly and tailor it to your needs in your email template.

HTML:

Template code block rendering HTML links
#set ($transitions = $!jetiFieldRenderer.getWorkflowActions($!issue))
#if ($!transitions && $!transitions.size() > 0)
#foreach($transition in $!transitions)
<a style="border-left:1px solid #ccc; padding:4px 10px; float:left;" href="$baseurl/secure/WorkflowUIDispatcher.jspa?id=$issue.id&action=$!transition.id">$!transition.name</a>
#end
#end

TEXT:

Template code block rendering links in Text emails
#set ($transitions = $!jetiFieldRenderer.getWorkflowActions($!issue))
#if ($!transitions && $!transitions.size() > 0)
#foreach($transition in $!transitions)
$stringUtils.leftPad($!transition.name, $padSize): $baseurl/secure/WorkflowUIDispatcher.jspa?id=$issue.id&action=$!transition.id
#end
#end

Form Token Errors will Occur

JIRA has protection against various web security vulnerability, like CSS, XSRF etc. JIRA uses form tokens in each links it exposes. These tokens are uniquely generated for each request/response. Read more details in the JIRA documentation.

We cannot workaround this token checking, this means when you open an operation link from email, you'll see an error screen like this even if you have a running session in your browser: 

When this is shown, simply click Retry Operations to execute the operation. You may still need to log in. After all these the operation will be called and you can proceed with the transition.