Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
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 Python, Ruby, Perl, 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.
- Seamless integration with Java - Groovy is friendly with the Java Runtime Environment and its syntax is aligned with Java
- Feature-rich language - Groovy has three main enhancements over and above those of Java: language features, libraries specific to Groovy, and additions to the existing Java standard classes (known as the Groovy Development Kit, or GDK)
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:
- Log in to your JIRA Server instance as an administrator.
- Go to the Administration icon and click on it.
- Click on
Issues - > Custom fields.
- Locate the custom field on the Custom Fields administration page.
- Click on the cog wheel and click on
Configure
- 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:
- On-the-fly syntax checking - to provide information about syntax errors in your script
- Automatic indentation of the code - for easy understanding of the code
- An online help system that helps you write Groovy code quickly
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.