Automation for Jira

ScriptRunner provides an action for Automation for Jira, that lets you run your own code.

Due to incompatibly changing APIs in Automation for Jira, we provide two actions. One is deprecated although there are no plans to remove it, and you do not need to migrate to the newer version unless you need access to something only available in the newer version.

Execute a ScriptRunner Script window in Automation for Jira

Both actions provide a way to run a "custom script", but you can call other ScriptRunner functions programmatically.

Binding Variables


The issue object that triggered the event


The ApplicationUser defined as the actor for the rule


The ApplicationUser that initiated the event


The ComponentInputs. This could be used for example to retrieve the sprint if the trigger is Sprint Created Event.


The current RuleContext. This can be used to evaluate smart values.

Additionally there are two utility functions available for writing information and error messages to the Automation for Jira audit log. They are addMessage(String message) and addError(String errorMessage)


addMessage("My message") addError("My error message")


Outcome of binding variables example.

Smart Values

You can evaluate smart values using ruleContext.renderSmartValues(String) for example:

log.warn ("Initiator of the action was... " + ruleContext.renderSmartValues('{{initiator}}'))

Deprecated version

Binding Variables


The issue object that triggered the event.


The ApplicationUser defined as the actor for the rule.


An ErrorCollection - use it to record error conditions, eg errorCollection.addErrorMessage("Something went wrong").


Use this if you need to retrieve any information about the rule that is currently firing.

On this page