Standard JIRA fields

This page explains how to access the value of Standard Jira fields using Groovy. You can access them using getters of the Issue interface. 

In this page:

Affects Version/s

  • Field Name: Affects Version/s

  • Field ID: versions

  • Description: The Affects Version/s field is a collection of version objects. Each object represents a single version.

  • Accessing the Affects Version/s field: You can access the Affects Version/s field using any of the following getters of the Issue interface:


Assignee

  • Field name: Assignee

  • Field ID: assignee

  • Description: The Assignee field is an object that represents the user who this issue is assigned to.

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


Attachments

  • Field name: Attachments

  • Field ID: attachment

  • Description: Attachment is a collection of objects. Each object represents a single attachment.

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

Comments

  • Field name: Comment

  • Field ID: comment

  • Description: The Comments field is a collection of objects. Each object represents one comment.
  • Accessing the Comments field: You can access the Comments field using any of the following getters of the Issue interface:
    • get("comment") or get("Comments") that returns a List<Comment>
      • Example: Number of comments on the issue:

        issue.get("comment").size()
      • Example: Last Comment body:

        if(issue.get("comment"))
        {
          issue.get("comment").last().getBody()
        }
      • Example: Name of the author of the first comment on the issue:

        if(issue.get("comment"))
        {
          issue.get("comment").first().getAuthorFullName()
        }
    • getAsString("Comments") or getAsString("comment") that returns a String with comma separated bodies of the comments:
      • Example: All the comments on the issue separated by a comma:

        issue.getAsString("comment")



Component/s

Created

  • Field name: Created

  • Field ID: created

  • Description: The Created field is a Timestamp that represents the date-time of issue creation.

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

To manipulate the date see here

Creator

  • Field name: Creator

  • Field ID: creator

  • Description: The Creator field is an object that represents the user who created this issue.

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

Description

  • Field name: Description

  • Field ID: description

  • Description: The Description field is a string representation of a multi-line text describing the issue.

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

Due Date

  • Field name: Due Date

  • Field ID: duedate

  • Description: The Due Date field is Timestamp representing the due date of the issue.

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

Environment

  • Field name: Environment

  • Field ID: environment

  • Description: The Environment field is a string representation of a multi-line text describing the environment of the issue.

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

Epic

  • Field name: Epic

  • Field ID: none

  • Description: Represents the issue's in the current Epic.

  • Accessing the Epic of an issue: You can access the Epic of an issue using the getEpic() that returns an Issue

    • Example: Get the Epic of the current issue

      issue.epic
    • Example: Get the status of the current issue's Epic

      issue.epic?.get("status")?.getName()
    • Example: Get the priority of the current issue's Epic

      issue.getEpic()?.get("priority")?.getName()

FixVersion/s

  • Field name: Fix Version/s

  • Field ID: fixVersions
  • Description: The Fix Version/s field is a collection of objects. Each object represents a single version.

  • Accessing the Fix Version/s fieldYou can access the Fix Version/s field using any of the following getters of the Issue interface:
      • Example: Join the names of the Fix Version/s, separated by commas:

        issue.getFixVersions().join(",")

ID

  • Field name: ID

  • Field ID: none

  • Description: The ID of the issue.

  • Accessing the ID of an issue: You can access the ID of the issue using getId() that returns ID of the issue in a Long format.

    • Example: ID of the issue

      issue.getId()


  • Field name: Issue Links

  • Field ID: issuelinks

  • Description: Issue links is a list of objects. Each object represents one issue link.

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

    • get("issuelinks") or get("Linked Issues") that returns a List<IssueLink>
      • Example: Get the issue links of the current issue

        issue.get("issuelinks")
    • getInwardIssueLinks() that returns a List<IssueLink>
      • Example: Number of inward linked issues for the current issue

        issue.getInwardIssueLinks().size()


    • getOutwardIssueLinks() that returns a List<IssueLink>
      • Example: Destination issue of the first issue link to the current issue

        if(issue.getOutwardIssueLinks())
        {
          issue.getOutwardIssueLinks().first().getDestinationObject()  
        }


    • getLinkedIssues(String linkName) that returns a List<Issue>
      • Example: Get the issues linked to the current issue with the 'blocks' link type

        issue.getLinkedIssues('blocks')
      • Example: Get the status of all issues linked to the current issue with the 'is blocked by' link type

        Status = []
        issue.getLinkedIssues('is blocked by').each{
          Status += it.getStatus().getName()
        }
        return Status

Issue type

  • Field name: Issue Type

  • Field ID: issuetype

  • Description: The Issue Type field is an object describing the issue type.

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

Key

  • Field name: Key

  • Field ID: issuekey

  • Description: The Key is a string that represents the key of the issue.

  • Accessing the Key of the issueYou can access the Key of the issue using any of the following getters of the Issue interface:

Labels

  • Field name: Labels

  • Field ID: labels

  • Description: Labels is a Set of labels.

  • Accessing the Labels field: You can access the Labels field using any of the following getters of the Issue interface:
    • getAsString("Labels") or getAsString("labels") that returns a String with comma separated label names:

      • Examples: Labels of the issue

        issue.getAsString("labels")


    • getLabels() that returns a Set<Label>

      • Example: Get the last label of the issue

        if(issue.getLabels())
        {
          issue.getLabels().last()
        }
      • Example: All the labels of the issue separated by a comma:

        issue.getLabels().join(",")


Last Viewed

  • Field Name: Last Viewed

  • Field ID: lastViewed

  • Description: The Last Viewed field is a string representation of a date-timestamp.

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

To manipulate the date see here


Original Estimate

  • Field name: Original Estimate

  • Field ID: timeoriginalestimate

  • Description: The Original Estimate field is a duration string representing the original time estimate.

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

Parent

  • Field name: Parent

  • Field ID: none

  • Description: Represents the parent of an issue. This applies only to sub-tasks.

  • Accessing the parent issue of an issue: You can access the parent of an issue using the getParentObject() that returns an Issue

    • Example: Get the username of the user to whom the current issue's parent is assigned:

      issue.parent?.getAssignee()?.getName()
    • Example: Get the status of the current issue's parent issue

      issue.getParentObject()?.get("status")?.getName()

Priority

  • Field name: Priority

  • Field ID: priority

  • Description: The Priority field is an object describing the priority of the issue.

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

Progress

  • Field name: Progress

  • Field ID: progress

  • Description: The Progress field is a field describing the progress on the issue.

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

Project

  • Field name: Project

  • Field ID: project

  • Description: The Project field is an object describing the selected project.

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

Remaining Estimate

  • Field name: Remaining Estimate

  • Field ID: timeestimate

  • Description: The Remaining Estimate field is a number or a duration string representing the remaining time estimate in seconds.

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

Reporter

  • Field name: Reporter

  • Field ID: reporter

  • Description: The Reporter field is an object that represents the user by whom the issue is reported.

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

Resolution

  • Field name: Resolution

  • Field ID: reporter

  • Description: The Resolution field is an object describing the resolution of the issue.

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

Resolved

To manipulate the date see here

Security Level

  • Field name: Security Level

  • Field ID: security

  • Description: The Security level field is an object describing the security level of the issue.

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

Status

  • Field name: Status

  • Field ID: status

  • Description: The Status field is an object describing the status of the issue.

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

Stories

  • Field name: Stories

  • Field ID: none

  • Description: Represents the issues in the current Epic.

  • Accessing the issues in an Epic: You can access the issues in an Epic using the getStories() that returns a List<Issue>

    • Example: Get the issues of an Epic that are in Closed status:

      def stories = issue.getStories().findAll{
        it.get("status").getName() == "Closed"
      }
      return stories
    • Example: Get the number of issues in the current Epic

      issue.getStories().size()

Subtasks

  • Field name: Sub-Tasks

  • Field ID: subtasks

  • DescriptionRepresents the subtasks of the current issue.

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

Summary

  • Field name: Summary

  • Field ID: summary

  • Description: The Summary field is a string representation of a single-line text describing the summary of the issue.

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

Time Spent

  • Field name: Time Spent

  • Field ID: timespent

  • Description: The Time spent field is a number representing the time spent on the issue in seconds.

  • Accessing the Time spent fieldYou can access the Time spent using any of the following getters of the Issue interface:

Updated

  • Field name: Updated

  • Field ID: updated

  • Description: The Updated field is a Timestamp representing the issue updated date-time.

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

To manipulate the date see here

Votes

  • Field name: Votes

  • Field ID: votes

  • Description: The Votes field is a collection of users who voted for issue.

  • Accessing the VotesYou can access the Votes field using any of the following getters of the Issue interface:

Watchers

  • Field name: Watchers

  • Field ID: watches

  • Description: The Watchers field is a collection of users watching the issue.

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

Work log

  • Field name: Log Work

  • Field ID: worklog

  • Description: The Work log field is a list of worklogs logged on the issue.

  • Accessing the Worklog: You can access the Log Work field using the get("worklog") or get("Log Work") that returns a List<Worklog>

    • Example: Time spent on the last work logged

      if(issue.get("Log Work"))
      {
        issue.get("Log Work").last().getTimeSpent()
      }


Work Ratio

  • Field name: Work Ratio

  • Key: workratio

  • Description: The Work Ratio field is a number representing the ratio of work done on the issue.

  • Accessing the Work Ratio fieldYou can access the Work ratio field using any of the following getters of the Issue interface:

∑ Original Estimate

  • Field name: Σ Original Estimate

  • Field ID: aggregatetimeoriginalestimate

  • Description: The aggregate original estimate field is a number representing the total original estimate of the issue and its sub-tasks if the issue has any.

  • Accessing the ∑ Original Estimate fieldYou can access the ∑ Original Estimate field using any of the following getters of the Issue interface:

∑ Remaining Estimate

  • Field name: Σ Remaining Estimate

  • Field ID: aggregatetimeestimate

  • Description: The aggregate remaining Estimate field is a number representing the total remaining estimate of the issue and its sub-tasks if the issue has any.

  • Accessing the ∑ Remaining Estimate fieldYou can access the ∑ Remaining Estimate field using any of the following getters of the Issue interface:

∑ Progress

  • Field name: Σ Progress

  • Field ID: aggregateprogress

  • Description: The Aggregate Progress field is an object describing the aggregate progress on the issue.

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

∑ Time Spent

  • Field name: Σ Time Spent

  • Field ID: aggregatetimespent

  • Description: The Aggregate time spent field is a number representing the total time spent on the issue and its sub-tasks if the issue has any.

  • Accessing the ∑ Time spent fieldYou can access the ∑ Time spent field using the