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 can be used as a scripting language for the Java Platform. To know more about Groovy, see the Groovy Documentation.
On this page:
Groovy in JMWE
Groovy in JMWE can be used either to write a Groovy expression or a Groovy template in the workflow extension configuration.
Groovy expression results in JMWE are used in:
- All post-functions with the Conditional execution section to execute a post-function conditionally
- Scripted (Groovy) operation on issue to execute a Groovy script against an issue
- Scripted (Groovy) condition to execute a condition
- Scripted (Groovy) validator to execute a validator
- Comment issue and Comment linked issues post-functions to create the body of the comment by selecting Groovy expression as the Comment type
- Create/Clone issuepost-function to
- Calculate a project
- Calculate a parent issue key
- Set fields of new issue by selecting Groovy expression as the Value type and
- Add a comment to the current issue by selecting Groovy expression as the Comment type
- Set field value to a constant or Groovy expression and Set field value of linked issues post-functions to set a field value by selecting Groovy expression as the Value type
- Email issue post-function to
- Write the Subject, HTML body, Text body
- Set the recipients from the script
- Unlink issues from the current issue post-function to unlink issues based on the result of a Groovy condition
- Admin screen to test/run Groovy scripts
Groovy templates in JMWE are used in:
- Comment issue and Comment linked issues post-function to create the body of the comment by selecting Groovy template as the Comment type
- Create/Clone issue post-function to:
- Set fields of new issue by selecting Groovy template as the Value type and
- Add a comment to the current issue by selecting Groovy template as the Comment type
- Set field value to a constant or Groovy expression and Set field value of linked issues post-functions to set a field value in the by selecting Groovy template as the Value type
- Email issue post-function to write the Subject, HTML body and Text body
- Link issues to the current issue post-function to write JQL search expression
Building Groovy script
You can start writing groovy scripts by going through the below references:
- Basics of Groovy - This document explains you some basic concepts of Groovy and provides references to Groovy tutorials.
- Groovy editor - This document explains you the Groovy editor in JMWE where you can write your Groovy script.
- Variables used in a groovy expression - This document explains you the variables available for your Groovy scripts and how to create new variables in your Groovy scripts.
- Issue Interface - The document details the main issue interface
- Accessing the fields of an issue - This document explains you on how to access the fields of an issue.
- Expected value for each field type when the value type is a Groovy expression - This document lists the expected values for each field type of your issue.
Groovy script tester - This document explains the Groovy script tester which helps you test your written script and debug it.