Getting started

This Tutorial introduces and familiarizes JMCF customers with writing Groovy scripts in the field configurations of some custom fields provided by JMCF to enhance the potential of the custom field value calculation. To write a Groovy script in JMCF you do not need to be proficient in the language, but a basic understanding of some simple and important concepts of the language is required. This tutorial teaches writing simple Groovy scripts that will get you started quickly and will give you more insight into Groovy and its use in JMCF. However, this is not a complete reference for the Groovy language. To acquire in-depth knowledge about it refer to the official documentation for Groovy that has plenty of tutorials and excellent documentation both for beginners and advanced users of the language.



On this page:



Before you begin:

By the end of this tutorial, you will be able to write simple Groovy scripts in JMCF.

Introduction to Groovy

Groovy is an object-oriented programming language for the Java platform. It is a dynamic language with features similar to those of PythonRubyPerl, and Smalltalk. It is easy to learn, has smooth Java integration, vibrant and rich ecosystem and powerful features. It brings the attractive benefits of dynamic languages to a robust and well-supported platform.

Tools to write Groovy scripts

Using IDE: You can use any IDE like IntelliJ IDEA or Eclipse or NetBeans to write your Groovy scripts and then copy them into JMCF custom field configurations. 

Using the Groovy editor: The JMCF add-on provides an integrated editor and tester that lets you write and test script. To write your script in the custom field configuration:

  1. Log in to your JIRA Server instance as an administrator.
  2. Go to the Administration icon  and click on it.
  3. Click on Issues - > Custom fields.
  4. Locate the custom field on the Custom Fields administration page.
  5. Click on the cog wheel and click on Configure
  6. Click on Edit Groovy Formula/Edit Format Expression, whichever is applicable

The Groovy editor is displayed. You can write your script and test it against an issue. The Groovy editor in JMCF has:

See here for more information on the Groovy editor and tester.

Start learning

To start learning about the Groovy language, click here. If you are already familiar with the Groovy language but would like to learn more about how to use it in JMCF, click here.