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.
Groovy in JMWE
Groovy script results in JMWE are used to:
- Set a field value by the Set field value to a constant or Groovy expression and Set field value of linked issues post-functions.
- Create the body of the comment by the Comment issue and Comment linked issues post-function
- Execute a post-function conditionally in all post-functions that have Conditional execution
- Execute a condition in the Scripted (Groovy) condition
- Execute a validator in the Scripted (Groovy) validator
On this page:
Building Groovy scripts
You can learn writing groovy scripts either by going through the learning material or from the tutorials listed below:
Tutorials
- Getting Started
- Explain what this tutorial about
- By the end of this tutorial...
- List what do you need before you begin
- Basics of Groovy
- Skip this is you already know Groovy
- Detail few basic concepts of Groovy
- if, for, closure, lambda expressions, safe-navigation operator etc
- References to Groovy tutorials (external)
- Where do you write your Groovy script
- Add a post-function,select "Groovy expression", Groovy editor is displayed.
- Rough introduction on Groovy editor and reference to its page.
- Tutorial - Value of a text field
- Tutorial - Write a condition
- Simple condition - A text field is empty (either using if or return the result of the comparision)
- Check the current user name. Using if 2. return the result of the comparision
- Tutorial -
- Using if
- Directly returning the result
- Comment
- Value
- Tutorial - Fetch the value of a text field
- Tutorial - Safe access
- Tutorial on
- Return
Write a script that returns a user
Reference material
- Basics of Groovy - This document explains you some basic concepts of Groovy and provides references to Groovy tutorials.
Groovy editor - This section 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 - Interfaces of the available variables
- 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 editor in JMWE - This document explains you the tool provided to debug your Groovy scripts.