Does anyone have any idea how to do this?
We'd like it if there were workflow-buttons included in an email template. Wouldn't it be great if I could "Resolve" or "Open" an issue directly from the HTML email I receive from JIRA?
Ed
Thanks Fabio.
I'm not adept enough with the Apache Velocity to do like you suggested, but I went ahead and "hard coded" my results.
I use the file at WEB-INF\classes\templates\email\html\includes\patterns\comment-action.vm -- this is the piece that adds the Comment link at the bottom of almost all outgoing JIRA notifications. I made some "if - elseif - end" loops to add the links based on the Status Name:
#disable_html_escaping() #set ($commentActionText = "${i18n.getText('jira.mentions.email.comment.add')}") #* @vtlvariable name="attachmentsManager" type="com.atlassian.jira.mail.util.MailAttachmentsManager" *# <table id="actions-pattern" cellspacing="0" cellpadding="0" border="0" width="100%"> <tr> <td id="actions-pattern-container" valign="middle"> <table align="left"> <tr> <td class="actions-pattern-action-icon-container"> Status: ${issue.getStatusObject().getSimpleStatus().getName()} -&nbsp; </td> #if(${issue.getStatusObject().getSimpleStatus().getName()} == "New") <td class="actions-pattern-action-icon-container"> <a href="${baseurl}/secure/WorkflowUIDispatcher.jspa?id=${issue.getId()}&action=4" target="_blank">Acknowledge</a>&nbsp;|&nbsp; </td> <td class="actions-pattern-action-icon-container"> <a href="${baseurl}/secure/WorkflowUIDispatcher.jspa?id=${issue.getId()}&action=1101" target="_blank">Stall</a>&nbsp;|&nbsp; </td> <td class="actions-pattern-action-icon-container"> <a href="${baseurl}/secure/WorkflowUIDispatcher.jspa?id=${issue.getId()}&action=5" target="_blank">Resolve</a>&nbsp;|&nbsp; </td> <td class="actions-pattern-action-icon-container"> <a href="${baseurl}/secure/WorkflowUIDispatcher.jspa?id=${issue.getId()}&action=1091" target="_blank">Reject</a>&nbsp;|&nbsp; </td> #elseif(${issue.getStatusObject().getSimpleStatus().getName()} == "Stalled") <td class="actions-pattern-action-icon-container"> <a href="${baseurl}/secure/WorkflowUIDispatcher.jspa?id=${issue.getId()}&action=1121" target="_blank">Resume</a>&nbsp;|&nbsp; </td> <td class="actions-pattern-action-icon-container"> <a href="${baseurl}/secure/WorkflowUIDispatcher.jspa?id=${issue.getId()}&action=5" target="_blank">Resolve</a>&nbsp;|&nbsp; </td> #end <td class="actions-pattern-action-text-container"> <a href="${baseurl}/browse/${issue.getKey()}#add-comment" target="_blank"><img class="actions-pattern-action-icon-image" src="$attachmentsManager.getImageUrl("/images/mail/comment-icon.png")" alt="$commentActionText" title="$commentActionText" height="16" width="16" border="0" />Comment</a> </td> </tr> </table> </td> </tr> </table>
Hi Edwin,
I did it in the past, you can update email template and embed in a button "resolved" or whatever you want. Each button should run a function that call the following REST service
Here Rest Api documentation : https://docs.atlassian.com/software/jira/docs/api/REST/latest/
Here, email template update way : https://confluence.atlassian.com/display/JIRA/Customizing+Email+Content
Hope this helps,
Fabio
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.