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 the getters of the Issue interface.

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

Capture for JIRA Browser

  • Field name: Capture for JIRA Browser

  • Description: The Capture for JIRA Browser field is a multi-line text field describing the browser of the page captured.

  • Accessing the Capture for JIRA Browser field: You can access the Capture for JIRA Browser field using any of the following getters of the Issue interface:
  • get("Capture for JIRA Browser") or get("customfield_xxxxx") that returns a String
    • Example: Capture for JIRA Browser field of the issue:

      Code Block
      languagegroovy
      linenumberstrue
      issue.get("Capture for JIRA Browser")


  • getAsString("Capture for JIRA Browser") or getAsString("customfield_xxxxx") that returns a String representing the browser of the page captured:

    • Example: Capture for JIRA Browser field of the issue:

      Code Block
      languagegroovy
      linenumberstrue
      issue.getAsString("Capture for JIRA Browser")


...

Panel
borderStylesolid

Capture for JIRA Document Mode

  • Field name: Capture for JIRA Document Mode

  • Description: The Capture for JIRA Document Mode field is a multi-line text field describing the document mode of the page captured.

  • Accessing the Capture for JIRA Document Mode fieldYou can access the Capture for JIRA Document Mode field using any of the following methods of Issue interface:

...

Panel
borderStylesolid

Capture for JIRA jQuery Version

  • Field name: Capture for jQuery Version

  • Description: The Capture for JIRA jQuery Version field is a multi-line text field describing the jQuery version of the page captured.

  • Accessing the Capture for JIRA jQuery Version fieldYou can access the Capture for JIRA jQuery Version field using any of the following getters of the Issue interface:

...

Panel
borderStylesolid

Capture for JIRA Operating System

  • Field name: Capture for JIRA Operating System

  • Description: The Capture for JIRA Operating system field is a multi-line text field describing the operating system of the page captured.

  • Accessing the Capture for JIRA Operating System fieldYou can access the Capture for JIRA Operating System field using any of the following methods of Issue interface:

...

Panel
borderStylesolid

Capture for JIRA Screen Resolution

  • Field name: Capture for JIRA Screen Resolution

  • Description: The Capture for JIRA Screen Resolution field is a multi-line text field describing the screen resolution of the page capture.

  • Accessing the Capture for Screen resolution fieldYou can access the Capture for Screen Resolution field using any of the following methods of Issue interface:

...

Panel
borderStylesolid

Capture for JIRA URL

  • Field name: Capture for JIRA URL

  • Description: The Capture for JIRA URL field is a string representation of a multi-line text describing the URL of the page captured.

  • Accessing the Capture for JIRA URL fieldYou can access the Capture for JIRA URL field using any of the following getters of the Issue interface:

...

Panel
borderStylesolid

Capture for JIRA User Agent

  • Field name: Capture for JIRA User Agent

  • Description: The Capture for JIRA User agent field is a multi-line text field describing the user agent of the page captured.

  • Accessing the Capture for JIRA User Agent fieldYou can access the Capture for JIRA User Agent field using any of the following getters of the Issue interface:

...

Panel
borderStylesolid

Raised during

  • Field name: Raised during

  • Description: The Raised during field is a string representing the ID of the session the issue was raised in.

  • Accessing the Raised during fieldYou can access the Raised during field using any of the following getters of the Issue interface:

...

Panel
borderStylesolid

Test sessions

  • Field name: Test sessions

  • Description: The Test sessions field is a string representing the ID's of the sessions the issue belongs to.

  • Accessing the Test Sessions fieldYou can access the Test Sessions field using any of the following getters of the Issue interface:

...

Panel
borderStylesolid

Testing status

  • Field name: Testing status

  • Description: The Testing status field is a string representing the status of the all the sessions the issue belongs to.

  • Accessing the Testing status fieldYou can access the Testing status field using any of the following getters of the Issue interface:

...

Panel
borderStylesolid

Epic Color

  • Field name: Epic Color

  • Description: The Epic Color field is a multi-line text field describing the color of the Epic.

  • Accessing the Epic Color fieldYou can access the Epic color field using any of the following getters of the Issue interface:

...

Panel
borderStylesolid
  • Field name: Epic Link

  • Description: The Epic link field is an object representing the Epic of the current issue.

  • Accessing the Epic Link fieldYou can access the Epic Link using any of the following getters of the Issue interface:

...

Panel
borderStylesolid

Epic Name

  • Field name: Epic Name

  • Description: The Epic Name field is a multi-line text field describing the name of the Epic.

  • Accessing the Epic Name fieldYou can access the Epic Name field using any of the following getters of the Issue interface:

...

Panel
borderStylesolid

Epic Status

  • Field name: Epic Status

  • Description: The Epic Status field is a multi-line text field representing the status of the Epic.

  • Accessing the Epic Status fieldYou can access the Epic status field using any of the following getters of the Issue interface:

...

Panel
borderStylesolid

Rank

  • Field name: Rank

  • DescriptionThe Rank field is a string representing the priority of the issue at a more granular level than issue priorities in Jira.

  • Accessing the Rank field: You can access the Rank field using any of the following getters of the Issue interface:

...

Panel
borderStylesolid

Sprint

  • Field name: Sprint

  • Description: The Sprint field is a collection of objects. Each object represents a Sprint.

  • Accessing the Sprint fieldYou can access the Sprint field using any of the following getters of the Issue interface:

    • get("Sprint") or get("customfield_xxxxx") that returns a  Collection<Sprint>

      • Example: First active Sprint the issue belongs to:

        Code Block
        languagegroovy
        linenumberstrue
        issue.get("Sprint").find(){
          it.getState() == "ACTIVE"
        }


      • Example: All the Sprint names the issue belongs to:

        Code Block
        languagegroovy
        linenumberstrue
        def names = []
        issue.get("Sprint").each(){
          names += it.getName()
        }
        names.join(",")


    • getAsString("Sprint") or getAsString("customfield_xxxxx") that returns a String with comma separated Sprint IDs

      • Example: Sprints the issue belongs to:

        Code Block
        languagegroovy
        linenumberstrue
        issue.getAsString("Sprint")


...

Panel
borderStylesolid

Story Points

  • Field name: Story Points

  • Description: The Story Points field is a number representing the story points.

  • Accessing the Story Points fieldYou can access the Story points field using any of the following getters of the Issue interface:
      • Example: Increase the story points by 10:

        Code Block
        languagegroovy
        linenumberstrue
        if(issue.get("Story Points"))
        {
          issue.get("Story Points") + 10
        }


    • getAsString("Story Points") or getAsString("customfield_xxxxx") that returns a String representing the Story points

      • Example: Story points of the issue:

        Code Block
        languagegroovy
        linenumberstrue
        issue.getAsString("Story Points")


...

Panel
borderStylesolid

Approvals

  • Field name: Approvals

  • Description: The Approvals field is a collection of objects. Each object represents an Approval.

  • Accessing the Approvals field: You can access the Approvals field using get("Approvals").getApprovals() or get("customfield_xxxxx").getApprovals() method of the Issue interface that returns a Collection<Approvals>

    • Example: Approvals on the issue:

      Code Block
      languagegroovy
      linenumberstrue
      if(issue.get("Approvals").getApprovals()) 
      {
        issue.get("Approvals").getApprovals().first().getName()
      }


...

Panel
borderStylesolid

Approvers

...

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")


To get the Customer Request Type name as displayed on the issue view, you can use the following snippet:

Code Block
languagegroovy
linenumberstrue
import com.atlassian.servicedesk.api.requesttype.RequestTypeService
def requestTypeService = getComponent(RequestTypeService)
def sourceIssueRequestTypeQuery = requestTypeService.newQueryBuilder().issue(issue.id).build()
def requestTypeEither = requestTypeService.getRequestTypes(currentUser, sourceIssueRequestTypeQuery)
if (requestTypeEither.isLeft()) {
        log.warn "${requestTypeEither.left().get()}"
        return false
    }
return requestTypeEither.right.results[0].name


...

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

Request participants

  • Field name: Request participants

  • Description: The Request Participants is an array of objects. Each object represents an ApplicationUser.

  • Accessing the Request Participants fieldYou can access the Request participants field using any of the following getters of the Issue interface:

...

Panel
borderStylesolid

Satisfaction

...

Panel
borderStylesolid

Satisfaction date

To manipulate the date see here

...

Panel
borderStylesolid

Time to resolution

  • Field name: Time to resolution

  • Description: The Time to resolution field is an object representing a SLA value.

  • Accessing the Time to resolution field: You can access the Time to resolution field using any of the following getters of the Issue interface:

...

Panel
borderStylesolid
  • Field Name: Parent Link
  • Description: The Parent link field is an object representing the Initiative of the current Epic. It returns com.atlassian.rm.jpo.env.issues.JiraIssueService$3.

  • Accessing the Parent Link fieldYou can access the Parent Link field using getAsString("Parent Link") or getAsString("customfield_xxxxx") that returns a String representing the key of the Initiative the Epic belongs to.

    • Example: Fetch the issue object of the Initiative the Epic belongs to:

      Code Block
      languagegroovy
      linenumberstrue
      def initiativeKey = issue.getAsString("Parent Link");
      if (initiativeKey==null)
        return null;
      return com.atlassian.jira.component.ComponentAccessor.getIssueManager().getIssueObject(initiativeKey);


...

Panel
borderStylesolid

Iteration

...

Panel
borderStylesolid

Team

  • Field name: Team

  • Description: The Team field is a string representing the ID of the tempo team.

  • Accessing the Team fieldYou can access the Team field using any of the following getters of the Issue interface:either the

...

Panel
borderStylesolid

Tempo Account

  • Field name: Account

  • Description: The Tempo Account field is an object representing the Tempo account the issue belongs to:

  • Accessing the Account fieldYou can access the Tempo Account field using any of the following getters of the Issue interface:

...