Adds the current user as a watcher
Use the Adds the current user as a watcher post function to add the currently logged-in user as a watcher when they transition the issue. You can apply conditions to this post function so the user is only added as a watcher in specific contexts. For example, you could add a condition so this post function only applies to Bug issues.
Use this post function
- Go to Administration > Issues > Workflows.
- Select Edit on the workflow you want to add a post function to.
- Select the transition to which you wish to add a post function.
- Under Options, select Post Functions.
- On the Transition page, select Add post function.
- Select Adds the current user as a watcher [ScriptRunner].
- Select Add.
- Optional: Enter a note that describes the post function (this note is for your reference when viewing all post functions).
Optional: Enter a condition. An empty condition evaluates the function to
true
.Example scripts
Select Example scripts in the script editor to find a selection of example scripts that you can use and adapt.
- Select Preview to see an overview of the change.
Select Add.
Reorder your new post functions using the arrow icons on the right of the function (they can only move one line at a time). Make sure this post function occurs after the pre-generated post functions.
Select Publish and choose if you want to save a backup copy of the workflow.
You can now test to see if this workflow condition works.