Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • Getting Started
    • Explain what this tutorial about
    • By the end of this tutorial...(not sure) - You would be able to write moderate Groovy scripts in JMWE.
  • Basics of Groovy
    • Skip this if 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/scripted condition/scripted validator of JMWE
    • Select "Groovy expression" option
    • The Groovy editor is displayed - Rough introduction on Groovy editor and reference to its actual page.
  • Tutorial - My first Groovy script
    • Fetch the key of the issue
    • issue.getKey()
    • Provide reference to the issue variable and the getKey() method
    • What do you get as the output - Refer the expected value of each field type document.
    • What can I do with this Groovy script result? - that is a String
      • Either add this as a comment/Set a field that expects a String as input.

...

  • Simple condition - Check whether a text field is empty or not
    • issue variable - Reference to variables documentation
    • Standard field, Access standard field doc reference
    • Custom field,  Access custom field doc reference
    • Compare the value to the required value
      • Use if() or
      • Optimize the code by returning the result of the comparison
  • Check the current user is a specific user
    • currentUser is the variable. - Reference to variables documentation
    • Explain its return value, and how to get the name of the user. -  Reference to User interface
    • Return the result of the comparison to the specific username
  • Check the priority of the issue
    •  issue variable - Reference to variables documentation
    •  Standard field - Expected input type of this field - Refer expected field type document
    •  Issue interface - getPriorityObject() or get("priority")
    •  Priority interface - getName()
    • Standard field, Expected field type - Check the priority - Priority object
    • Since it is an object, it has properties to look up to
    • Priority interface- refer

...


Welcome to the JMWE add-on specific tutorials which are practical guides using Groovy scripting for creating advanced workflows. This collection of tutorials show you how to accomplish certain functional use cases with Groovy scripts in the workflow extensions of JMWE.

Note

You will need a fresh test Jira Server instance, which you will restore from a backup in the next step.



Panel

On this page:

Table of Contents


Pre-requisites

Before starting this tutorial you should have basic knowledge of

Objective

By the end of this tutorial:

  • You will have a local Jira Server test instance with workflow extensions having Groovy scripts. (warning) Note that the end product is not a complete functional workflow.
  • You will have a good understanding of how to use Groovy in the JMWE add-on.

About the tutorial

This tutorial guides you through the following chapters:

Child pages (Children Display)
excerptTypesimple