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. 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.

...

Table of Contents

...

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. 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.


In this page:

Table of Contents

Capture for JIRA 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

Browser

Document Mode

  • Field name: Capture for JIRA BrowserDocument Mode

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

  • Accessing the Capture for JIRA Browser field: You Document Mode fieldYou can access the Capture for JIRA BrowserDocument Mode field using any of the following getters methods of the Issue interface: Browser that
    • that returns a String
      • Example: Capture for JIRA

      Browser
      • Document mode field of the issue:

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


    • getAsString("Capture for JIRA
    Browser browser
    • document mode of the page captured:
      • Example: Capture for JIRA

      Browser
      • Document mode field of the issue:

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



Panel
borderStylesolid

Capture for JIRA

Document Mode

jQuery Version

  • Field name: Capture for JIRA Document ModejQuery Version

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

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


Panel
borderStylesolid

Capture for JIRA

jQuery Version

Operating System

  • Field name: Capture for jQuery VersionJIRA Operating System

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

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


Panel
borderStylesolid

Capture for JIRA

Operating System

Screen Resolution

  • Field name: Capture for JIRA Operating SystemScreen Resolution

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

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


Panel
borderStylesolid

Capture for JIRA

Screen Resolution

URL

  • Field name: Capture for JIRA Screen ResolutionURL

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

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


Panel
borderStylesolid

Capture for JIRA

URL

User Agent

  • Field name: Capture for JIRA URLUser Agent

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

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


Panel
borderStylesolid
Capture for JIRA User Agent

Raised during

  • Field name: Capture for JIRA User AgentRaised during

  • Description: The Capture for JIRA User agent Raised during field is a multi-line text field describing the user agent of the page capturedstring representing the ID of the session the issue was raised in.

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


Panel
borderStylesolid
Raised during

Test sessions

  • Field name: Raised duringTest sessions

  • Description: The Raised during Test sessions field is a string representing the ID's of the session sessions the issue was raised inbelongs to.

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


Panel
borderStylesolid
Test sessions

Testing status

  • Field name: Test sessionsTesting status

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

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

Jira Software fields

Panel
borderStylesolid
Testing status

Epic Color

  • Field name: Testing statusEpic Color

  • Description: The Testing status field is a string representing the status of the all the sessions the issue belongs toEpic Color field is a multi-line text field describing the color of the Epic.

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

...



Panel
borderStylesolid
Color
  • Field name: Epic ColorLink

  • Description: The Epic Color link field is a multi-line text field describing the color of the Epican object representing the Epic of the current issue.

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


Panel
borderStylesolid

Epic

Link

Name

  • Field name: Epic LinkName

  • Description: The Epic link Name field is an object representing the Epic of the current issuea multi-line text field describing the name of the Epic.

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


Panel
borderStylesolid

Epic

Name

Status

  • Field name: Epic NameStatus

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

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


Panel
borderStylesolid
Epic Status

Rank

  • Field name: Epic StatusRank

  • Description: The Epic Status  The Rank field is a multi-line text field string representing the status priority of the Epicissue at a more granular level than issue priorities in Jira.

  • Accessing the

    Epic Status

    Rank field:

     You

     You can access the

    Epic status

    Rank field using any of the following getters of the Issue interface:


Panel
borderStylesolid
Rank

Sprint

  • Field name: RankSprint

  • Description: The Rank  The Sprint field is a string representing the priority of the issue at a more granular level than issue priorities in Jiracollection of objects. Each object represents a Sprint.

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

    • get("RankSprint") or get("customfield_xxxxx") that returns a LexoRank.

      Example: Rank of the parent issue

       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.getParentObject()?.get("Rank.get("Sprint").each(){
          names += it.getName()
        }
        names.join(",")


    • getAsString("RankSprint") or getAsString("customfield_xxxxx") that returns a LexoRank representing the Rank of the issue: String with comma separated Sprint IDs

      • Example: Rank of Sprints the parent issue belongs to:

        Code Block
        languagegroovy
        linenumberstrue
        issue.getParentObject()?.getAsString("RankSprint")



Panel
borderStylesolid
Sprint

Story Points

  • Field name: SprintStory Points

  • Description: The Sprint Story Points field is a collection of objects. Each object represents a Sprint.number representing the story points.

  • Accessing the Sprint Story Points fieldYou can access the SprintStory points field using any of the following getters of the Issue interface:
      • Example:

    • All the Sprint names the issue belongs to
      • Increase the story points by 10:

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

    • getAsString("SprintStory Points") or getAsString("customfield_xxxxx") that  that returns a Stringwith comma separated Sprint IDs representing the Story points

      • Example:Sprints Story points of the issue belongs to:

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


Jira Service Desk fields

Panel
borderStylesolid
Story Points

Approvals

  • Field name: Story PointsApprovals

  • Description: The Story Points Approvals field is a number representing the story pointscollection of objects. Each object represents an Approval.

  • Accessing the

    Story Points

    Approvals field:

     You

     You can access the

    Story points

    Approvals field using

    any of the following getters of the Issue interface:

    get("

    Story Points"

    Approvals").getApprovals() or get("customfield_xxxxx"

    ) 

    ).getApprovals() method of the Issue interface that returns a

    Double

    Collection<Approval>

    • Example:

      Story points of the story

      Approvals on the issue:

      Code Block
      languagegroovy
      linenumberstrue
      if(issue.get("
      Story Points")
    • 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("
      Approvals").getApprovals()) 
      {
        issue.get("Approvals").getApprovals().first().getName()
      }



Panel
borderStylesolid

Approvers

  • Field name: Approvers

  • Description: The Approvers field is an array of objects. Each object represents an ApplicationUser.

  • Accessing the Approvers fieldYou can access the Approvers field using any of the following getters of the Issue interface:
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

Jira Service Desk fields

if(issue.get("Approvals").getApprovals()) { issue.get("Approvals").getApprovals().first().getName() }
  • Names of all approvers who approved the issue:

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



Panel
borderStylesolid
Approvers

Customer Request Type

  • Field name: ApproversCustomer Request Type

  • Description: The Approvers Customer Request Type field is represents an array of objects. Each object represents an ApplicationUserobject describing the information about the Service Desk used to create the ticket.

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

      Names of all approvers who approved the issue

      Customer request type:

      Code Block
      def names = []
      issue.get("
      Approvers").each(){ names += it.getName() } names.join(","
      Customer Request Type")?.getRequestTypeKey()


  • getAsString("ApproversCustomer Request Type") or getAsString("customfield_xxxxx") that  that returns a  String with comma separated Approvers usernames String representing the request type name:
    • Example:

      Names of all approvers who approved the issue

      Customer request type:

      Code Block
      issue.getAsString(
      "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")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

Satisfaction

...

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:

    • get("Time to resolution") or get("customfield_xxxxx") that returns a SLA Value:

      • Example: Start time of the last completed cycle of the 'Time to first responseresolution' SLA:

        Code Block
        issue.get("Time to resolution")?.getLastCompletedCycle()?.get()?.getStartTime()
      getAsString
      • getStartTime()


    • getAsString("Time to resolution") or getAsString("customfield_xxxxx") that returns a String representing the SLA Value:

      • Example: Start time of the last completed cycle of the 'Time to resolution' SLA:

        Code Block
        issue.getAsString("Time to resolution")


    • getAsJsonData("Time to resolution") or getAsStringgetAsJsonData("customfield_xxxxx")  that returns a String representing the SLA Value:the JSON version of the field being accessed.
      • Example:  Start time of the last completed cycle of the 'Time to first response' SLATo check whether the Time to resolution SLA has been breached:

        Code Block
        issue.getAsStringgetAsJsonData("Time to resolution").getData()?.getOngoingCycle()?.getBreached()


        Note

        You can access any other SLA field in a similar way as shown above.


Portfolio for Jira fields

Panel
borderStylesolid
field

Tempo fields

Panel
borderStylesolid

Iteration

...