How to trigger issue transition from the message from "Display message to user (JMWE app)"
The Display message to user (JMWE app) post-function displays a message to the user triggering the transition, as a “flag” in the top right corner of the issue view page or Jira Software board. This article explains how to trigger a transition on an issue from the message displayed by "Display message to user (JMWE app)"
Instructions
Navigate to the intended workflow to make the necessary changes in the edit mode.
Select the required transition.
Select the Post functions tab and click
Add post function
.Add the "Display message to user (JMWE app)" post-function.
Add appropriate “Message title:”, “Message body:” and “Message type:”
Select the checkbox “Add action link” under “Action link”
Add appropriate “Action title:”, select “Action type:” as “Navigate to URL” and add the below in URL :
<% jira = ComponentAccessor.getApplicationProperties().getString("jira.baseurl") import com.atlassian.jira.security.xsrf.SimpleXsrfTokenGenerator def XSRFToken = ComponentAccessor.getComponent(SimpleXsrfTokenGenerator).generateToken() print "${jira}/secure/WorkflowUIDispatcher.jspa?id=${issue.id}&action=TRANSITION_ID&atl_token=${XSRFToken}" %>
Replace TRANSITION_ID
in the above snippet with the id of the target transition.
Make sure the target transition added above is available from the current status of the issue, and the Condition(s), Validator(s) added (if any) on the target transition must return true for the transition to execute successfully.
With this, when the Action title is clicked from the message pop-up, the target transition is executed.