[All Adaptavist Apps]

Page tree

Behaviours are built on the UI Modifications API provided by Atlassian. Described below are some of the common errors that can occur as a result of using that API for the Behaviours feature.

Example Error

A common error that can occur within the ScriptRunner for Jira Cloud Behaviours feature happens when you set the wrong value type. That is, if you have a script that uses the setValue() method and the value of the field is set using the wrong data type, then you will see an error message displayed.

In this instance, you will see the error message appear on the Create issue screen when a behaviours script fails to run, as shown below:

Effect:

The result of this type of error means that all changes made in the UI do not take effect, and in turn, any behaviours that have been configured on other fields also do not run.

Resolution:

To resolve this error, you need to review the behaviours scripts mapped to the affected issue type and ensure that you are setting the correct value type for the field being set. The value types associated with each field are described on the Behaviours API page.

If you have set the wrong value type you will see a code linting error in your script. This highlights that the value being set is incorrect when writing your code, as shown below.

It's important to note that if you are setting the Description field, you will not see a warning if you set a string value and the Description field is using a Wiki Text Renderer (you can also set this field to use a Plain Text Renderer in the field configuration). In this case, we advise you to check the type configured for the Description field and set the value to Atlassian Document Format for a Wiki Text Renderer, or a string for a Plain Text Renderer.