[All Adaptavist Apps]
In order to use the Behaviours feature, you must install ScriptRunner for Jira Cloud and then proceed to install a separate ScriptRunner Behaviours Forge app. It is important to follow the correct sequence for these installations as the Behaviours features will not work if you install the app before installing ScriptRunner for Jira Cloud. If this does happen, you can uninstall and reinstall the Behaviours app. As an existing ScriptRunner customer, the ScriptRunner Behaviours Forge app is free to use.
Behaviours give you more control over fields in Jira. A field configuration customizes how fields behave across an instance. However, a behaviour in ScriptRunner for Jira Cloud allows you to take that field customization further, defining how fields behave for issues in a given project or issue context.
Behaviours provide you with options that enable you to customize how fields in Jira behave. Therefore, you can give your users clear direction when filling in fields on the Create Behaviour screen. For example, you may want to create a behaviour that hides a field for a specific user until it's relevant for that user to interact with that particular field.
You can create a behaviour that will:
Prefill/preformat a template when an issue is created so users can easily follow it.
Behaviours can be applied to supported fields on the Global Issue Create view only. Additionally, conditions may only be set on the following supported fields:
Behaviours in ScriptRunner for Jira Cloud can be used to reinforce your business processes. It's beneficial to think of a behaviour as one of your business rules or use cases and understand that it will only affect fields on projects and issue types specified by you.
Within the behaviours feature, you can choose to change or alter one or more fields. These are known as the Affected Fields and are essential to initiate a behaviour. As such, they must be defined from the outset and are mandatory. Additionally, it is essential to determine the timing of when the script on the affected field should run: when the create screen first loads or when a change has been made to another field.
A fundamental difference between the ScriptRunner for Jira Server/DC and ScriptRunner for Jira Cloud behaviours feature is that the field selected is the trigger that causes the behaviour to run in ScriptRunner for Jira Server/DC. However, with ScriptRunner for Cloud, you choose an affected field first and then write a script with logic that will alter that field in your preferred way.
There are currently two platforms on which Jira apps can be built: Atlassian Connect and the newer Atlassian Forge. ScriptRunner for Jira Cloud is built on the Connect platform, but this does not facilitate the Behaviours feature. Atlassian created an API called UI Modifications on the Forge platform, which made it possible for ScriptRunner to build behaviours. Therefore, this means that in order to use the Behaviours feature, a separate Forge app needs to be installed alongside ScriptRunner for Jira Cloud.
As more capabilities become available in the UI Modifications API, more functionality can be built in ScriptRunner's Behaviours feature.
To install the ScriptRunner Behaviours Forge app, follow these steps:
Understand Atlassian's UI Modifications API.
Some points worth noting about behaviours from the outset:
Click the Add Field button to choose the field the behaviour will affect - this is called the Affected Field. You will see the Select Affected Field pop up window displayed where you can choose an Affected Field.
Follow the steps below to edit a behaviour in ScriptRunner for Jira Cloud: