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.
...
- Transition names or IDs provided under
@Transition Id
or@TransitionName
HTML comments to theTransition(s) to look for
custom field configuration option - Transition execution details provided under
@Execution
to HTML comment to theTransition Execution
custom field configuration option - Formats provided under
@@Format
to HTML comment to theDate Format
custom field configuration option - Formats provided under
@@ColFormat
to HTML comment to theDate Column Format
custom field configuration option - Field names provided under
@@Field
to HTML comment to theField to look for
custom field configuration option
...
Note that BeanShell formulas in @@Formula
, @@Format
and @@ColFormat
HTML comments @@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.
Migrating from BeanShell to Groovy
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:
- Locate the custom field on the Custom Fields administration page.
- Click on the cog wheel and click on
Configure
- Click on
Edit Groovy Formula
orEdit Format Expression.
- The Formula under the
@@Formula
tag will HTML comments will be copied to theGroovy formula
field. - Click on
Save.
When you save the Groovy formula
or Format Expression
:
- The script will be converted to the Groovy language and will be stored, upon saving, outside of the field's Description.
- The HTML comment containing BeanShell script in the field's Description will be modified to include the following warning:
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 .2 using the following steps:
...
Log in to Jira as an administrator.
Click on the Administration icon . Navigate to Add-ons > Manage Add-ons.
- Under User-Installed Add-ons, search for Jira Misc Workflow Extensions and click on it.
- Click on Uninstall.
- Download version 1.7.2 of JMCF from this link
- Click on the
Upload add-on
link to on and upload the jar file downloaded in step 3.
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.
...