[All Adaptavist Apps]
Note | ||
---|---|---|
In order to use the | ||
Excerpt | ||
| ||
Learn all about Behaviours in ScriptRunner for Jira CloudBehaviours feature, you must install ScriptRunner for Jira Cloud and then proceed to install a separate ScriptRunner Behaviours 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 a ScriptRunner customer, the ScriptRunner Behaviours 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 let you extend the standard field configuration options available in Jira and give you the power to use contextual information like current field values, workflow step name, or user details as conditional logic.
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 group until it's relevant for them to interact with that particular field.
You can create a behaviour that willYou can create behaviours to:
Prefill/preformat a template for users to follow template when an issue is created so users can easily follow it.
Make a custom field read-only depending on the workflow state.
Dynamically make calls to external data sources based on user selections when an issue is created.
Hide a custom field depending on the value of another custom field.
...
Hide or show a supported field only to people in a specific role.
Info |
---|
Note that hidden fields can still be submitted if a user edits the HTML form or modifies browser requests. |
Behaviours can be applied to supported fields on the Global Issue Create view only. Additionally, modifications may only be made 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 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 supported field.
Info |
---|
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. |
Anchor | ||||
---|---|---|---|---|
|
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.
Info |
---|
When installing the ScriptRunner Behaviours Forge app a list of permissions, or Jira Core scopes and Jira Software scopes, are presented for approval. This is required by the app in order to run successfully. You can refer to the Forge Scopes section for more information. |
To install the ScriptRunner Behaviours app, follow these steps:
Info |
---|
Currently, if Forge apps are uninstalled, then you will no longer have access to that data. However, if you uninstall the Behaviours app, ScriptRunner will continue to store your data, so if you decide at a later time to reinstall it, your data will still exist |
...
. |
Column | ||
---|---|---|
| ||
***Our training module helps you learn how to set up and use behavioursBefore setting up a behaviour, read about Jira field configurations. |
Column | ||
---|---|---|
| ||
Column | ||
---|---|---|
| ||
***Before you set up a behaviour be sure to read about the Behaviour Limitations. This can also help troubleshoot getting your behaviour to work |
Section | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Note |
---|
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.
Info |
---|
The Affected Fields are fields that are being changed or altered. They are not the fields that act as triggers for the changes or alterations. |
Determine when the behaviour script will run, either On load or On change (or both).
When | Runs |
---|---|
On load | The script will run when the create screen initially loads. You'll want to choose this option when you want the affected field to populate immediately upon opening the create screen. For example, a field name or field description is changed, or a value is pre-populated into the field. |
On change | The script will run when the specified supported field change happens. You may want to run the script initially when it loads AND if a change has occurred. You'll want to choose this option when you've added a condition to the logic and identified a trigger that will update the affected field. So if you would like to run the script after the user alters a field on the create screen, then choose the On change option. |
Note |
---|
Choosing to use the Insert Example Code script will replace anything that is already contained within the Script box. |
Note |
---|
Atlassian’s initial beta release of the UI Modifications API requires each user to allow access to the Behaviours app. As such, the first time you create an issue where a behaviour is mapped, you will need to allow access to the Forge app (one time only). Granting access allows you to create issues on a screen that has been modified by the UI Modifications API. If access is not granted, then you will not be able to create an issue from screens that have been modified by a behaviour. Granting access is a temporary step; rest assured, Atlassian is working to improve the user experience and remove it. You can follow Atlassian’s ticket here. |
After access has been granted, the following screen displays:
Once you have clicked on the Accept button, you are returned to the Behaviours screen.
Follow the steps below to edit a behaviour in ScriptRunner for Jira Cloud: