As This User

Script listeners can make requests back to Jira using either the add-on user (ScriptRunner Add-On User) or the user that is setting up the listener (Current User).

When using the Initiating User, any action occurring as a result of the function is registered as being performed by them. For example, if an issue is commented on, the comment comes from the Initiating User rather than the obscure ScriptRunner Add-on User who may have nothing to do with the issue/project affected.

Permissions are considered when executing actions. The user selected in the Run as User field must have the correct permissions to do the action specified. Typically the ScriptRunner Add-on User has project admin permissions; however, this can be restricted. The Initiating User may have higher permissions than the ScriptRunner Add-on User.

Script listeners can make requests back to Jira using either the ScriptRunner Add-on user or the user that performed the action to cause the event to be fired. See the Run As User section of Workflow Extensions for more information.

Evaluate Condition

The condition will be evaluated before the execution of your code. In case it returns other value than true, the code will not execute. The condition is evaluated using Evaluate Jira expression, so please refer to the documentation for correct syntax and context variables available.

There is default Context variables "user" (app is not supported yet by Atlassian) and variables specific to the chosen event. e.g for issue related events the Context variables will be "issue" and "user", for sprint related events the Context variables will be "sprint" and "user"

Condition Examples

  • issue related events, " ⇒ c.body)" stops the execution as the result is not true but a list of objects

  • issue related events, "issue.comments.length == 2" succeeds for issues with 2 comments

  • sprint related events, "issue.comments.length == 2" errors as issue is not available in the context of sprint event, code will not execute

  • issue related events, "'^(Bug|Task)$') != null" succeeds only for issues with issue type, Bug or Task

  • issue related events, "issue" stops the execution, you can see the returned value from the execution in the execution detail and check available fields

  • all events, "user.key == 'special-user-key'", runs the code only if the user performing the event is 'special-user-key'

Script Context

The Script Context is a set of parameters/code variables that are automatically injected into your script to provide contextual data for the script listeners. They are displayed immediately above the code editor. The parameters in the Script Context are different for each Event.

Common parameters in the Script Context for all the events are:

  • baseUrl - Base url to make API requests against. This is the URL used for relative request paths e.g. if you make a request to /rest/api/2/issue we use the baseUrl to create a full request path.

  • logger - Logger to use for debugging purposes. Check the methods available org.slf4j.Logger

  • timestamp - The timestamp of the event in milliseconds e.g. 1491562297883

  • webhookEvent - The webhook event type. Atlassian Connect Webhook Documentation

Event-specific Script Context are listed below for each event.


Script listeners are by default set to run for all projects. This can be changed per Script Listener to run for selected projects only.

This filtering only applies to issue, issuelink (source issue), version, project and comment related events. In case you require filtering on issuelinks on both source and destination issue add both projects to the filter.