Potentially breaking change - Script JQL Functions are now Singletons

If you only use the JQL functions included in ScriptRunner this won’t affect you, but if you have written your own, please read on.

We have fixed a couple of race conditions in JQL functions that may have caused problems under extreme load. JQL function classes are now only instantiated once. This may cause a problem if you have written your function class to have state, e.g. shared fields that are written from the validate method and read from the getQuery method. In the unlikely event this is the case, please refactor your JQL function.

Version Synchroniser delete behaviour modified for deleting and swapping to missing versions.

When a version is deleted, you can specify the actions to be taken for issues associated with the version to be deleted. One of the options is to associate these issues with another version. A new option has been added to control the propagation of these events with the Version Synchroniser:

Previously, on a Version Deleted event, if there was a version in the swap that was not present in the source project, the version in the destination project would be deleted, and there was no control over that functionality. That could potentially lead to an unintended loss of information, imagine the following scenario:

Project A has versions 1 and 2, and Project B has version 1, but it does not have version 2.

The Version Synchroniser event listener is active with source project A and destination project B.

If a delete version event is called in project A, and in that event, it is specified that version 1 is to be deleted and swapped with version 2, that would work in project A because both versions exist. However, when that event is propagated through the Version Sync Listener to project B, it would delete version 1, and it wouldn???t swap to version 2, because version 2 does not exist.

That could lead to a loss of information in project B.

In order to prevent this loss of information, the default behaviour has been modified to copy the version to the target project if it is not contained in that project. In the previous scenario, the new Version Synchroniser would realise the version that the user wants to swap to is missing in the target project, and it would create it there. That way the swap can be completed successfully and there is no information lost.

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.