Accessing the fields of an issue

This document details how to access the details of issue objects, such as the one provided by the issuelinkedIssue and parentIssue variables, as well as Issue objects returned by other methods such as getParentObject()getEpic() or getLinkedIssues(). You can access them using the:

  • Getters of the Issue interface methods that are native to Jira.
  • get(String fieldNameOrID) method returns the value of a system or custom field of the Issue object. The return type depends on the field being accessed. 
  • getAsString(String fieldNameOrID) method that returns the String representation of the value of the system or custom field, whenever possible.
  • getRawValue(String fieldNameOrID) method that returns an Option object instead of a String when applied on a field of Single select list or Radio buttons type.
  • getAvailableOptions("String fieldNameOrID") method that returns a collection of available options for the specified field
  • getRemoteLinks(<Application Name>) method takes a String representing the target application (e.g. "jira", "confluence" etc) and returns a Collection<RemoteIssueLink> objects. 
  • getAsJsonData(String fieldNameOrID) method returns the value of the field as a JsonData object. The return type is a JSON-style version of the field, essentially a key-value Map.
  • getFieldHistory(String fieldNameOrID) method that returns returns a List<ChangeItemBean>This gives easy access to the history of any field. The order of the list will be from oldest to newest.

where <field_name> is the name of the field as displayed in the Field configuration and <field_id> is the ID of the field as shown in Accessing the Jira Standard fields of an issue document. In the case of a custom field, it has the form customfield_xxxxx, where xxxxx is the custom field numerical ID, as seen in the URL when viewing or editing the field.

An issue has the following fields. Click on each to know how to access them: