Make sure you have completed the activity set up tasks before attempting this activity.

Track Transition an Issue

For this example, we are transitioning a payroll issue. In your instance, experiment with the issues you have.

  1. Access Script Listeners from the the Manage Apps page.

  2. Click Create Listener, and then click Fast-Track Transition an Issue.

    This is also where you edit existing listeners. Just click the Cog to open a menu, and then click Edit.
  3. 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.

  4. 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 issues that are high priority only.

    ListenerCondition
  5. Lastly, set your intended Action, which is what will happen to the issue when the event occurs. For our example, we choose the action Start Progress and select Skip Permissions.

    You can set additional issue actions, if you choose.
    listenerChooseAction

    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.

  6. When you are finished with your settings, click Add to add the listener. 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

  1. Access Script Listeners from the the Add-Ons page.

  2. Click Add New Item, and then click Adds the Current User as a Watcher.

  3. 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.

  4. 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.

    ConditionexampleListener
  5. Add the listener and then test to make sure the listener is functioning as you intend it to function.

Have questions? Visit the Atlassian Community to connect, share, and learn with other Atlassian users and experts, including Adaptavist staff.

Ask a question about ScriptRunner for JIRA, Bitbucket Server, or Confluence.

Want to learn more? Check out courses on Adaptavist Learn, an online platform to onboard and train new users for Atlassian solutions.