Release 8.x

8.2.0

New Features

Key Summary Status
Loading...
Refresh

Bugs Fixed

Key Summary Status
Loading...
Refresh

8.1.0

New Features

Key Summary Status
Loading...
Refresh

Bugs Fixed

Key Summary Status
Loading...
Refresh

8.0.0

Groovy 4 update

We have updated ScriptRunner for Bitbucket to Groovy 4!

Our primary motivator for this update is to provide support for JDK 17. Groovy 3 doesn't support JDK 17, and with Jira 9.5.0 and Confluence 8.0 being JDK 17 compatible, an upgrade to Groovy 4 is necessary.

So, apart from JDK 17 compatibility, what comes with this update and how will it benefit you? 

New features in Groovy 4

The following are the most significant new features that have been added in Groovy 4 :

Please have a look at the Groovy 4 Release Notes for a complete list of new features.

Breaking changes in Groovy 4

Groovy 4 contains a number of breaking changes. The ones which are the most significant, and likely to affect ScriptRunner users, are listed below. Please have a look at the Groovy 4 Release Notes for a complete list of breaking changes.

1) Changes to the resolution of properties with both a getter and isser returning different types

An isser is a method to retrieve boolean properties. Instead of the method name starting with get (as is common for accessor methods), it starts with is. See the JavaBean Properties tutorial for more information.

For properties that have a getter and an isser returning different types (for example, JiraAuthenticationContext#getLoggedInUser and JiraAuthenticationContext#isLoggedInUser) when accessing the property, instead of calling one of the methods (for example, jiraAuthenticationContext.loggedInUser), the getter is called in Groovy 3 but the isser is called in Groovy 4 - see GROOVY-10821.

Solution

From Groovy 4 if you have custom classes, or are using external classes that implement conflicting isser and getter methods, and you are using the property syntax to get the getter value, you must re-write the logic to use the getter method directly.

For example, this class demonstrates conflicting isser and getter methods:

class GetterIsser {   String getSomething() { 'yes' }   boolean isSomething() { false } }   def myClass = new GetterIsser()   myClass.something // used to return 'yes', as of Groovy 4 will return false

From Groovy 4, this should be written as:

class GetterIsser {   String getSomething() { 'yes' }   boolean isSomething() { false } }   def myClass = new GetterIsser()   myClass.getSomething() // will return 'yes'
2) Legacy package removal

Groovy 3 provided duplicate versions of numerous classes (in old and new packages) to allow Groovy users to migrate towards the new JPMS compliant package names - see the section about it in Groovy 3 Release Notes for more details. Groovy 4 no longer provides the duplicate legacy classes.

For backward compatibility reasons ScriptRunner still ships with deprecated version of groovy.util.XmlSlurper and groovy.xml.XmlParser. We recommend you don't use these legacy classes going forward and use their equivalents that can be found in groovy.xml package.

3) Changes related to how Groovy code accesses private fields from within closures

Groovy developers are currently attempting to improve how their code accesses private fields in certain scenarios where such access is expected but problematic. For example, within closure definitions, where subclasses or inner classes are involved (GROOVY-5438). You may notice breakages in Groovy 4 code in such scenarios until they fix this issue.

4) Change to intersect() default Groovy method

intersect() default Groovy method used to draw elements from the second argument passed to it, but now it draws elements from the first argument passed to it - see GROOVY-10275.

JVM Flags
Important notice for Java 17 users

There is currently an omission in the Bitbucket archive that may cause compatibility issues with Java 17. You need to manually add the following JVM flags to avoid these issues:

java
 --add-opens java.base/java.lang.reflect=ALL-UNNAMED  --add-opens java.base/java.io=ALL-UNNAMED 

See this Resolution in Atlassian’s documentation for an example of how to add a JVM argument. Use this example as a guide to add the JVM flags listed above. 

These flags are required to address module encapsulation introduced in Java 9 and later, which can cause issues when using reflection or accessing certain internal APIs. We are working closely with Atlassian to address this issue in future releases. 

New Features

Key Summary Status
Loading...
Refresh

Bugs Fixed

Key Summary Status
Loading...
Refresh


On this page