Writing scripts in JMCF using the Groovy language


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 can be used as a scripting language for the Java Platform. It is easy to learn, has smooth Java integration, vibrant and rich ecosystem and powerful features. To know more about Groovy, see the official Groovy Documentation.

On this page:

Learning Groovy

To learn more about the Groovy language:

Groovy in JMCF

Groovy can be used in JMCF to write a Groovy script in the Groovy Formula section of the custom field configuration and return the result of the evaluation. It is applicable to:

  • Calculated Date/Time custom field type, to return a java.util.Date
  • Calculated Duration custom field type, to return a duration String or a number in a Long format representing the number of seconds
  • Calculated Multi-select field custom field type, to return a String representing a comma-separated list of option values/ids or an array of option values/ids or a collection of option objects
  • Calculated Multi-user field custom field type, to return a String representing a comma-separated list of usernames or an array of usernames or a collection of ApplicationUser objects
  • Calculated Number custom field type, to return a number and to format the returned value in the Format expression field
  • Calculated Single-select custom field type, to return a String representing an Option value/id or an Option object
  • Calculated Single-user custom field type, to return a String representing a username or an ApplicationUser object
  • Calculated Text Field custom field type, to return a String representing a single/multi- line text.

Writing Groovy scripts in JMCF

To learn how to write groovy scripts for JMCF, see: