This document is intended for JMCF users who are migrating from version 1.7 to version 2.x. JMCF has moved from BeanShell Scripting to Groovy, and also has a vast number of advanced features and new custom fields to offer. Though the migration is pretty straightforward there are certain things that you need to be aware of.
On this page:
In JMCF 1.7, calculated custom field configuration was stored as HTML comments inside the field's Description, which can be seen on the custom field's Edit screen.
Starting with JMCF 2.0.0, calculated custom field configuration is now stored in its own database tables inside the Jira database (using Atlassian Active Objects), and edited on the custom field's Configure screen. This means that the HTML comments inside the field's Description are now ignored.
When you upgrade to JMCF 2.x for the first time, an automatic upgrade task is run to convert:
@Transition Id
or @TransitionName
HTML comments to the Transition(s) to look for
custom field configuration option@Execution
HTML comment to the Transition Execution
custom field configuration option@@Format
HTML comment to the Date Format
custom field configuration option@@ColFormat
HTML comment to the Date Column Format
custom field configuration option@@Field
HTML comment to the Field to look for
custom field configuration optionAll corresponding HTML comments are modified to include the following warning: WARNING: ignored in JMCF 2.x. Edit the field's Configuration instead.
Once you are certain you will not be downgrading to JMCF 1.7 (see Reverting to JMCF 1.7 below), you can safely remove the HTML comments from the custom field Description.
Note that BeanShell formulas in @@Format
HTML comments of the Calculated Number custom field type and @@Formula
HTML comments of any applicable calculated custom field type are not converted automatically. See the next section for details.
BeanShell scripts inside the field's Description will continue to be used, and will be evaluated using the BeanShell scripting engine, until you edit and save them on the custom field's Configure screen. Once they are saved on that screen, they will replace the corresponding script from the field's Description, and will from now on be evaluated using the Groovy scripting engine.
To convert a BeanShell script to Groovy:
Configure
Edit Groovy Formula
or Edit Format Expression.
@@Formula
HTML comments will be copied to the Groovy formula
custom field configuration option.Save.
When you save the Groovy formula
or Format Expression
:
WARNING: ignored in JMCF 2.x. Edit the field's Configuration instead.
While Groovy is generally compatible with the BeanShell language, some scripts might need to be adjusted. Here are the main syntax differences that you will need to take into account, although it is very unlikely that you will encounter them in your scripts.
We strongly encourage you to test your script before saving, using the "Test groovy script" button at the top of the editor.
Description | Example | Replace with | ||
---|---|---|---|---|
You can define a method implicitly in BeanShell. But the Groovy interpreter considers it as a Closure. | For example:
returns a compilation error | You need to define the method explicitly as:
returns 3 | ||
Unsupported commands - unset(), invoke() |
returns a
returns a | No equivalent exists in Groovy. |
We have conducted extensive tests to make sure that existing JMCF 1.7 configurations will continue to work after upgrading to JMCF 2. However, due to the large variety of use cases, you might still encounter an issue after upgrading to JMCF 2. If that happens, you can revert to JMCF 1.7 using the following steps:
Log in to Jira as an administrator.
Click on the Administration icon . Navigate to Add-ons > Manage Add-ons.
Note that JMCF 1.7.2 will revert to the Description-based configuration and thus ignore any change you might have made on custom field Configure screens.
Naturally, we would love to hear about any issue you encounter after the upgrade. Please reach out to our Support team so we can help you take advantage of all the new features JMCF 2 has to offer!