Details
-
Bug
-
Status: To Do
-
Low
-
Resolution: Unresolved
-
6.40.0
-
None
-
0.8
Description
When setting a description for a custom Labels field via Behaviour, while the Description field under the Custom Field Details has already an existing value, the current description will get overwritten by what's being set via Behaviour. The custom Labels field will then have 2 description div elements.
Steps to Reproduce the Problem
- Create a custom field of Labels field type
- Give it a Name and Description e.g. Description (Custom Field Details)
- For comparison purposes, create another Text Field custom field
- Note the current description under the field
- Navigate to the Behaviours page > Create Behaviour > map it to a project & All issue types
- In the Add Field section, select the custom field you've just created > Add
- Create Initialiser and add the following script to it > click Save
getFieldByName("Custom Labels").setDescription("Description (set via Behaviour)") getFieldByName("Text Field").setDescription("Description (set via Behaviour)")
- Note the description duplicates under the field. The Description (Custom Field Details) text that was set earlier is overwritten by the description set via the Behaviour
Expected Behaviour
One of the descriptions should take precedence over the other. For the Text Field, it's the description set via the Behaviour.
Actual Behaviour
Both the descriptions added under the Custom Field Details and set via Behaviour appear under the Labels field. The former gets overwritten by the latter.
Workaround
Remove the description added to the field under the Custom Field Details section
Additional Info
- Reproduced in
Jira Software 8.20.7 | ScriptRunner 6.40.0
Jira Software 9.0.0 | ScriptRunner 6.54.0 (latest Jira & ScriptRunner versions)