Scripting in ScriptRunner for Jira Cloud
ScriptRunner for Jira Cloud allows you to extend the functionality of Jira Cloud, executing scripts to interact with Jira as Workflow Extensions or Script Listeners. Scripts can be useful for automating regular actions, such as updating an issue during a transition or performing a calculation and storing the result in a custom field on the issue.
Outlined below are the various programming languages used for scripting and their associated features within ScriptRunner for Jira Cloud:
|Workflow Extension: Condition|
|Workflow Extension: Post Function|
|Workflow Extension: Validator|
Scripting is not used for this feature, it utilises two fields to add a variable which you can call out in other scripts, such as password.
Utilising the Groovy programming language you can respond to events and transitions and manipulate Jira using the REST API. Additionally, you can use the Enhanced Search feature to run JQL Functions in Jira Cloud and create filters for dashboards and scrum boards that use those functions.
ScriptRunner for Jira Cloud domain allowlist
We advise all customers with a Cloud firewall to ensure that access to the *.connect.product.adaptavist.com wildcard URL is permitted.
When using the Behaviours feature, note that if your Jira instance is using IP allow-lists, you need to expand that to include the Atlassian Forge IP address range and all AWS IP ranges for the region you're in. Refer to Atlassian's IP addresses and domains for Atlassian cloud products and AWS IP Ranges for more details.
How to call external applications from ScriptRunner for Jira Cloud
ScriptRunner for Jira Cloud can execute rest calls to third-party REST APIs. The simplest way to test executing these calls is to use the Script Console.
To start integrating with an external application, we recommend following the steps below:
- Contact the support team for the external application and request some examples of how to use their REST API.
- Locate the REST API documentation for the external application.
- Test interacting with the REST APIs for the external application on the Script Console ensuring that Script Variables are used to store any passwords or authorization tokens.
We also recommend using the Post to Slack example Script Listener as it provides an example of how to call an external REST API from ScriptRunner for Jira Cloud and can be used as an example to create the script that you require.