Our new Appfire Documentation Space is now live!

Take a look here! If you have any questions please email support@appfire.com

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 118 Next »

This document details the methods you can use on any Issue object, such as the one provided by the issue, linkedIssue and parentIssue variables (where applicable), as well as Issue objects returned by other methods such as getParentObject()getEpic() or getLinkedIssues().

Methods of the Issue interface: 

(green star) denotes a method that is specific to JMWE

On this page:

All methods of the Issue interface:

Methods to access issue fields and information

MethodDescriptionParametersReturn type

get(String fieldNameOrID) (green star)

Returns the value of a system or custom field of the Issue object.A string representing the field name or field IdDepends on the field being accessed

get(String fieldNameOrID, Object defaultValue) (green star)

Returns the value of a system or custom field of the Issue object. If the value is null, it returns the default value specified as the second parameter. 
  1. A string representing the field name or field Id
  2. An object representing the field default value
Depends on the field being accessed

getAffectedVersions()

Returns a collection of Affects Version/s objects, an empty collection if there are no affects versions.None

Collection<Version>

getAssignee()

Returns the Assignee user, null if the issue is not assigned.None

ApplicationUser

getAsJsonData(String fieldNameOrID) (green star)

Returns the JSON-style version of a system or a custom field of the Issue object, essentially a key-value MapThis can be useful to access some complex Jira Software and Jira Service desk fields.A string representing the field name or field IdJsonData

getAsString(String fieldNameOrID) (green star)

Same as the get method, but returns a String representation of the value of the system or custom field, whenever possible.A string representing the field name or field IdString

getAsString(String fieldNameOrID, String defaultValue)(green star)

Same as the get method, but returns a String representation of the value of the system or custom field, whenever possible. If the value is null, it returns the default value specified as the second parameter. The defaultValue must be a String.
  1. A string representing the field name or field Id
  2. A string representing the field default value
String

getAttachments()

Returns a collection of attachment objects, an empty collection if there are no attachments.

NoneCollection<Attachment>

getComponentObjects()

Returns a collection of project components (as objects) that this issue is assigned to, an empty collection if there are no components.

NoneCollection<ProjectComponent>

getCreated()

Returns the timestamp of the issue creation.NoneTimestamp

getCreator()

Returns the user who created the issue.NoneApplicationUser

getDescription()

Returns the description of the issue, null if there is no description for the issueNoneString

getDueDate()

Returns the due date of the issue, null if there is no due date set for the issueNoneTimestamp

getEnvironment()

Returns the Environment of the issue, null if there is no Environment set for the issueNoneString

getEstimate()

Returns the "remaining estimate" of work left to be performed on this issue, in milliseconds, null if empty.

NoneLong

getFixVersions()

Returns a collection of Fix Version/s objects, an empty collection if there are no Fix versions.

NoneCollection<Version>

getId()

Returns the ID of the issueNoneLong

getIssueTypeId()

Returns the ID of the issue type of the issue.NoneString

getIssueType()

Returns the issue type object of the issueNoneIssueType

getKey()

Returns the key of the issueNoneString

getLabels()

Returns the labels of the issue, empty Set if no labels.NoneSet<Label>

getNumber()

Returns the issue number in the projectNoneLong

getOriginalEstimate()

Returns the "original estimate" of work to be performed on this issue, in milliseconds, null if empty.NoneLong

getPriorityObject()

Returns the Priority for this Issue.

NonePriority

getProjectId()

Returns the ID of the Project for this Issue.

NoneLong

getProjectObject()

Returns the Project for this Issue.

NoneProject

getRawValue(String fieldNameOrID) (green star)

Same as the get method, but for Single-Select type custom fields, returns an Option object instead of a StringA string representing the field name or field IdDepends on the field being accessed

getReporter()

Returns the Reporter of the issueNoneApplicationUser

getResolutionDate()

Returns the timestamp of when an issue was resolved. Will be null if it hasn't been resolved yet, or if an issue has been returned to the 'unresolved' state.

NoneTimestamp

getResolutionId()

Returns the ID of the resolution of the issue, if anyNoneString

getResolution()

Returns the Resolution for this Issue, null if the issue hasn't been resolved yet, or if an issue has been returned to the 'unresolved' state.

NoneResolution

getSecurityLevelId()

Returns the Security level for this issue, null if there is no Security level set for the issueNoneLong

getStatus()

Returns the status of the issueNoneStatus

getSummary()

Returns the summary of the issueNoneString

getTimeSpent()

Returns the "total time spent" working on this issue, in milliseconds, null if empty.

NoneLong

getUpdated()

Returns the timestamp of the issue updateNoneTimestamp

getVotes()

Returns the number of votes for the issue, null if empty.NoneLong

getWatches()

Returns the number of watchers for the issue, null if empty.NoneLong

getWorkflowId()

Returns the ID of the workflow the issue belongs toNoneLong

isCreated()

Returns true when the issue is createdNoneBoolean

isEditable()

Returns true when the issue is editableNoneBoolean

isSubTask()

Returns true when the issue is a sub-taskNoneBoolean

Methods to access issue's linked issues

MethodDescriptionParametersReturn type

getEpic() (green star)

Returns the Epic, if any, of the current issue. null if the issue doesn't belong to an Epic.NoneIssue

getInwardIssueLinks() (green star)

Returns a list of inward issue links to the issue, an empty list if there are no inward issue links.NoneList<IssueLink>

issue.getIssueLinks() (green star)

Returns a list of issue links from/to the current issue. This can be used to set the Linked Issues fieldNoneList<IssueLinkWithDirection>

issue.getIssueLinks(String linkType)

 (green star)
Returns a list of issue links from/to the current issue with a specific link type. This can be used to set the Linked Issues field.linkType: The name of a link type, as it appears on the issue viewList<IssueLinkWithDirection>

issue.getIssueLinks(Long linkTypeId, String direction) (green star)

Returns a list of issue links from/to the current issue with a specific link type and direction. This can be used to set the Linked Issues field.

linkTypeId: A number representing the link type id (e.g. 10300 ).

direction: The link type direction (outward or inward)

List<IssueLinkWithDirection>

getLinkedIssues() (green star)

Returns a list of issues linked to the current issue (including the issue links being added on the transition screen during a transition) through any regular link type.

(warning) Note: Supports all issue links other than Parent-Subtask (see getParentObject() and getSubTaskObjects() for that), Epic-Story (seegetEpic()andgetStories()for that) and Parent-Child portfolio (see getPortfolioParent() and getPortfolioChildIssues() for that)

NoneList<Issue>

getLinkedIssues(String linkType) (green star)

Returns a list of issues linked to the current issue (including the issue links being added on the transition screen during a transition) through a specific link type.linkTypeA string representing  the name of a link type, as it appears on the issueview (e.g. blocks or is blocked by).List<Issue>

getLinkedIssues(Long linkTypeId, String direction) (green star)

Returns a  list of issues linked to the current issue (including the issue links being added on the transition screen during a transition) through the specified link type Id and direction.

For example: getLinkedIssues(10301, “inward”) returns issues linked inward to the current issue through the link type with Id 10301.

linkTypeID: A number representing the link type id (e.g. 10300 ).

direction: The link type direction (outward or inward)

List<Issue>

getOutwardIssueLinks() (green star)

Returns a list of outward issue links from the issue, an empty list if there are no outward issue links.NoneList<IssueLink>

getParentObject()

Returns the parent Issue, or null if the issue is not a subtask.

NoneIssue

getPortfolioChildIssues()(green star)

Returns a list of issues linked to the current issue through the "is parent of (Portfolio child Issues)" link typeNoneList<Issue>

getPortfolioParent()(green star)

Returns the issue linked to the current issue through the "is child of (Portfolio Parent Link)", or null if the issue is not a child.NoneIssue

getRemoteLinks(String ApplicationName) (green star)

Returns a collection of remote issue links of the current issue to the target application (e.g. "jira" or "confluence"). When the ApplicationName is null all the remote issue links are returned.applicationNameA string representing the remote link application name of a link type, as it appears on the Application Links pageCollection<RemoteIssueLink>

getStories() (green star)

Returns a list of stories of the current Epic, an empty list if there are no StoriesNoneList<Issue>

getSubTaskObjects()

Returns the subtasks of this issue, an empty collection if no subtasks

NoneCollection<Issue>

Methods to link issues

MethodDescriptionParametersReturn type

linkIssue(String linkType, Issue destIssue) (green star)

Links the current issue to the specified issue through the specified link type direction

linkType: A string representing  the name of a link type, as it appears on the issue view (e.g. blocks or is blocked by).

destIssue: The issue to link to.

void

linkIssue(String linkType, String destIssueKey) (green star)

Links the current issue to the issue with the specified issue key through the specified link type direction

linkType: A string representing  the name of a link type, as it appears on the issue view (e.g. blocks or is blocked by).

destIssue: A string representing the key of the issue to link to.

void

linkIssue(Long linkTypeID, String direction, Issue destIssue) (green star)

Links the current issue to the specified issue through the specified link type id and direction.

linkTypeID: A number representing the link type id (e.g. 10300 ).

direction: The link type direction (outward or inward)

destIssue: The issue object to link to.

void

linkIssue(Long linkTypeID, String direction, Issue destIssueKey) (green star)

Links the current issue to the issue with the specified issue key through the specified link type id and direction.

linkTypeID: A number representing the link type id (e.g. 10300 ).

direction: The link type direction (outward or inward)

destIssueKey: The key of the issue to link to.

void

Methods to set issue field value

MethodDescriptionParametersReturn type

setFieldValue(String fieldNameOrId, Object value) (green star)

Sets the value of a system or custom field of the Issue object

Use this method only in the Scripted Groovy operation post-function or in the Groovy console or in the Shared Groovy scripts.

Use the "Set field of new issue" and "Transition screen" sections of the Create issue and Transition post-functions respectively to set field values.

fieldNameOrId: A string representing the name or ID of a standard or custom field

Object value: The value to set the field to.

void

Methods to access issue properties

MethodDescriptionParametersReturn type

deleteEntityProperty(String propertyName) (green star)

Deletes the specified Entity property of the issue.propertyName: A string representing the name of the Entity Propertyvoid

getEntityProperty(String propertyName) (green star)

The value of the specified Entity property of the issue, parsed into a Groovy object.A string representing the name of a propertyObject

setEntityProperty(String propertyName, Object value) (green star)

Sets the value of the specified Entity property of the issue to a JSON representation of the specified value.

propertyName: A string representing the name of the Entity Property

Object value: The value to set the field to.

void

setEntityPropertyToJsonString(String propertyName, String jsonString) (green star)

Sets the value of the specified Entity property of the issue to the specified JSON string.

propertyName: A string representing the name of the Entity Property

jsonString: A String representing the JSON string value to set.

void

Other methods

MethodDescriptionParametersReturn type

addAvailableOption(String fieldNameorID, String value) (green star)

Adds the provided value as a new possible option to the mentioned field.

Only applies to fields that have a fixed list of possible values, such as Affects Version/s, Fix Version/s, Components, Radio buttons, Checkboxes, Single select and Multi-select list type custom fields.

fieldNameOrId: A string representing the name or ID of a standard or custom field

value: The value to set the field to.

void

addRemoteIssueLink(RemoteIssueLink remoteIssueLink) (green star)

Adds a remote issue link to the issue.

RemoteIssueLink object representing the remote issue link

For example: issue.getRemoteLinks("<ApplicationLinkName>")

void

getAvailableOptions(String fieldNameOrID) (green star)

Returns a collection of available options for a field, which can be:

Both field names and field IDs are supported, just like on the get() method. See here for the list of supported fields.

A string representing the field name or field IdCollection<Object the field returns>

getFieldHistory(String fieldNameOrID) (green star)

Returns the history of a system or custom field of the Issue object.A string representing the field name or field IdList<ChangeItemBean>

getModifiedFields()

Retrieves a map of issue fields that have been modified during the current transition.NoneMap<String,ModifiedValue>

getServiceDeskUrl() (green star)

Returns the URL of the issue's customer request view.  Only applies to Service Desk requests. Returns null otherwise.NoneString

getUrl() (green star)

Returns the URL of the issue's View screen.NoneString
  • No labels