Change to behaviours' getValue() output on Linked Issues field

Prior behaviour

There was some inconsistency in the object type which getValue() returned when called on the Linked Issues field (i.e. getFieldById("issuelinks-issues")).

linked issues field
  • If the field contains no issues: ""

  • If the field contains one issue: "ISSUE_KEY"

  • If the field contains multiple issues: [FIRST_ISSUE_KEY, SECOND_ISSUE_KEY, etc.]

Notice the differences in the object types. Two are strings, one is an array.

New behaviour

As of this release, getValue() will always return an array for the Linked Issues field. This new behaviour is documented in the Behaviours API Quick Reference.

We are aware that this change will break backwards compatibility for some users. Take a look at the new outputs below to see what adjustments you need to make to your scripts.

  • If the field contains no issues: []

  • If the field contains one issue: [ISSUE_KEY]

  • If the field contains multiple issues: [FIRST_ISSUE_KEY, SECOND_ISSUE_KEY, etc.]

Bug fixes and Features

For how-to questions please ask on Atlassian Answers where there is a very active community. Adaptavist staff are also likely to respond there.

Ask a question about ScriptRunner for JIRA, for for Bitbucket Server, or for Confluence.