Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page explains how to access the value of Pre-defined custom fields using Groovy. You can access them using either the methods native to Groovy or the methods provided by JMWE.the getters of the Issue interface. To understand how to write values into the writable custom fields see Raw value/text input for fields and Groovy expression input for fields

Note

'xxxxx' in the custom fields detailed below is the ID of the custom field. Click here to know how to find the ID of the custom fields.

...

Panel
borderStylesolid

Customer Request Type

  • Field name: Customer Request Type

  • Description: The Customer Request Type field represents an object describing the information about the Service Desk used to create the ticket.

  • Accessing the Customer request type fieldYou can access the Customers Request Type field using any of the following getters of the Issue interface:
  • get("Customer Request Type") or get("customfield_xxxxx") that returns VpOrigin
    • Example: Customer request type:

      Code Block
      issue.get("Customer Request Type")?.getRequestTypeKey()


  • getAsString("Customer Request Type") or getAsString("customfield_xxxxx") that returns a String representing the request type name:
    • Example: Customer request type:

      Code Block
      issue.getAsString("Customer Request Type")


...

Panel
borderStylesolid

Organizations

  • Field name: Organizations

  • Description: The Organizations field represents an array of Strings describing the Organizations the issue belongs to

  • Accessing the Organizations field: You can access the Organizations field using any of the following getters of the Issue interface:
  • get("Organizations") or get("customfield_xxxxx") that returns a Collection<Organization>
    • Example: Number of Organizations the issue belongs to:

      Code Block
      issue.get("Organizations")?.size()

      Names of the Organizations:

      Code Block
      issue.get("Organizations")?.join(",")


  • getAsString("Organizations") or getAsString("customfield_xxxxx") that returns a String with comma separated Organization ID's:

    • Example: Names of Organizations:

      Code Block
      issue.getAsString("Organizations")


...

Panel
borderStylesolid

Satisfaction

...