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 under an
@Execution
HTML comment to theTransition Execution
custom field configuration option - Formats provided under an
@@Format
HTML comment to theDate Format
custom field configuration option - Formats provided under under an
@@ColFormat
HTML comment to theDate Column Format
custom field configuration option - Field names provided under under an
@@Field
HTML comment to theField to look for
custom field configuration option
...
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
HTML comments will be copied to theGroovy formula
custom field configuration option. - 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. |
...
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 ExtensionsCustom Fields and click on it.
- Click on Uninstall.
- Download version 1.7.2 of JMCF from this link
- Click on and upload the jar file.
...