Listener Activities
Make sure you have completed the activity set up tasks before attempting this activity.
Fast-track transition an issue
For this example, we are transitioning a payroll issue. In your instance, experiment with the issues you have.
- From ScriptRunner, select the Listeners tab.
Click Create Listener, and then click Fast-track transition an issue.
Select the appropriate project key and choose your Event(s) to trigger the listener. For our example, we are going to set the listener to listen for Issue Commented.
If you want, set a condition on the listener. This condition can restrict the listener to match what you specify in the condition. For our example, we restrict to issue priority and listen for high-priority issues only.
Lastly, set your intended Action, which is what will happen to the issue when the event occurs. For our example, we choose Start Progress and Skip Permissions.
You can set additional issue actions if you choose.
You can allow the listener to skip workflow conditions and validators, as well as permissions-this may be useful in case a user doesn’t have a specific permission to perform an action, but you want that action to take place for cases where the listener applies.
When you are finished with your settings, select Add. The listener will now be in effect for your instance and listening for the event(s) you selected. To test your listener, complete the action within the conditions (if applied) to ensure your action completes.
When fast track transitioning an issue, the issue needs to be in the status directly before the destination status. You cannot skip statuses when completing the fast-track transition.
Add current user as a watcher
- From ScriptRunner, select the Listeners tab.
Select Create Listener, and then click Adds the current user as a watcher.
Select the appropriate project key and choose the Event(s) to trigger the listener. For our example, we are going to set the listener to listen for Issue Assigned, so when the current user assigns an issue, they are added as a watcher on the issue, but only if they are in the Administrators role.
If you choose, set a condition on the listener. This condition can restrict the listener to match what you specify in the condition. For our example, we use a condition to check that the user is a member of the Administrators role.
Add the listener and then test to make sure the listener is functioning as you intend it to function.