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:
Note |
---|
denotes a method that is specific to JMWE |
Panel | ||||
---|---|---|---|---|
On this page:
|
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
All methods of the Issue interface:
|
Methods to access issue fields and information
get(String fieldNameOrID)
Depends on the field being accessed
get(String fieldNameOrID, Object defaultValue)
- A string representing the field name or field Id
- An object representing the field default value
Depends on the field being accessed
getAffectedVersions()
getAssignee()
getAsJsonData(String fieldNameOrID)
JsonData
getAsString(String fieldNameOrID)
get
method, but returns a String representation of the value of the system or custom field, whenever possible.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:
Note |
---|
denotes a method that is specific to JMWE |
Panel | ||||
---|---|---|---|---|
On this page:
|
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
All methods of the Issue interface:
|
Methods to access issue fields and information
Method | Description | Parameters | Return type |
---|---|---|---|
| Returns the value of a system or custom field of the Issue object. | A string representing the field name or field Id |
|
| 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. |
|
|
| Returns a collection of Affects Version/s objects, an empty collection if there are no affects versions. | None | |
| Returns the Assignee user, null if the issue is not assigned. | None | |
| Returns the JSON-style version of a system or a custom field of the Issue object, essentially a key-value Map. This can be useful to access some complex Jira Software and Jira Service desk fields. | A string representing the field name or field Id | |
| Same as the | A string representing the field name or field Id | |
| Same as the |
| |
| Returns a collection of attachment objects, an empty collection if there are no attachments. | None | |
| Returns a collection of project components (as objects) that this issue is assigned to, an empty collection if there are no components. | None | |
| Returns the timestamp of the issue creation. | None | |
| Returns the user who created the issue. | None | |
| Returns the description of the issue, | None | |
| Returns the due date of the issue, | None | |
| Returns the Environment of the issue, | None | |
| Returns the "remaining estimate" of work left to be performed on this issue, in milliseconds, | None | |
| Returns a collection of Fix Version/s objects, an empty collection if there are no Fix versions. | None | |
| Returns the ID of the issue | None | |
| Returns the ID of the issue type of the issue. | None | |
| Returns the issue type object of the issue | None | |
| Returns the key of the issue | None | |
| Returns the labels of the issue, empty Set if no labels. | None | |
| Returns the issue number in the project | None | |
| Returns the "original estimate" of work to be performed on this issue, in milliseconds, null if empty. | None | |
| Returns the Priority for this Issue. | None | |
| Returns the ID of the Project for this Issue. | None | |
| Returns the Project for this Issue. | None | |
| Same as the | A string representing the field name or field Id |
String
getAsString(String fieldNameOrID, String defaultValue)
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.- A string representing the field name or field Id
- A string representing the field default value
String
getAttachments()
Returns a collection of attachment objects, an empty collection if there are no attachments.
Collection<Attachment>
getComponentObjects()
Returns a collection of project components (as objects) that this issue is assigned to, an empty collection if there are no components.
Collection<ProjectComponent>
getCreated()
Timestamp
getCreator()
ApplicationUser
getDescription()
null
if there is no description for the issueString
getDueDate()
null
if there is no due date set for the issueTimestamp
getEnvironment()
null
if there is no Environment set for the issueString
getEstimate()
Depends on the field being accessed | |||
| Returns the Reporter of the issue | None | |
| Returns the timestamp of when an issue was resolved. Will be | None | |
| Returns the ID of the resolution of the issue, if any | None | |
| Returns the Resolution for this Issue, | None | |
| Returns the Security level for this issue, | None | |
| Returns the status of the issue | None | |
| Returns the summary of the issue | None | |
| Returns the "total time spent" working on this issue, in milliseconds, | None | |
| Returns the timestamp of the issue update | None | |
| Returns the number of votes for the issue, | None | |
| Returns the number of watchers for the issue, | None |
| Returns |
Collection<Version>
true when the issue is created | None |
Long
getIssueTypeId
| Returns |
true when the issue |
is editable | None |
String
getIssueType
| Returns |
true when the issue is a sub-task | None |
IssueType
getKey()
String
getLabels()
Set<Label>
getNumber()
Long
getOriginalEstimate()
Long
getPriorityObject()
Returns the Priority for this Issue.
Priority
getProjectId()
Returns the ID of the Project for this Issue.
Long
getProjectObject()
Returns the Project for this Issue.
Project
getRawValue(String fieldNameOrID)
get
method, but for Single-Select type custom fields, returns an Option object instead of a StringgetReporter()
ApplicationUser
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.
Timestamp
getResolutionId()
String
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.
Resolution
getSecurityLevelId()
null
if there is no Security level set for the issueLong
getStatus()
Status
getSummary()
String
getTimeSpent()
Returns the "total time spent" working on this issue, in milliseconds, null
if empty.
Long
getUpdated()
Timestamp
getVotes()
null
if empty.Long
getWatches()
null
if empty.Long
getWorkflowId()
Long
isCreated()
Boolean
isEditable()
Boolean
isSubTask()
Boolean
Methods to access issue's linked issues
getEpic()
null
if the issue doesn't belong to an Epic.Issue
getInwardIssueLinks()
List<IssueLink>
issue.getIssueLinks()
List<IssueLinkWithDirection>
issue.getIssueLinks(String linkType)
linkType
: The Methods to access issue's linked issues
Method | Description | Parameters | Return type |
---|---|---|---|
| Returns the Epic, if any, of the current issue. | None | |
| Returns a list of inward issue links to the issue, an empty list if there are no inward issue links. | None | |
| Returns a list of issue links from/to the current issue. This can be used to set the Linked Issues field | None | |
| 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. |
| |
| 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. |
| |
| 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. Note: Supports all issue links other than Parent-Subtask (see | None | |
| 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. |
| |
| 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: |
| |
| Returns a list of outward issue links from the issue, an empty list if there are no outward issue links. | None | |
| Returns the parent Issue, or null if the issue is not a subtask. | None | |
| Returns a list of issues linked to the current issue through the "is parent of (Portfolio child Issues)" link type | None | |
| Returns the issue linked to the current issue through the "is child of (Portfolio Parent Link)", or | None | |
| Returns a collection of remote issue links of the current issue to the target application (e.g. "jira" or "confluence"). When the |
| |
| Returns a list of stories of the current Epic, an empty list if there are no Stories | None | |
| Returns the subtasks of this issue, an empty collection if no subtasks | None |
Methods to link issues
Method | Description | Parameters | Return type |
---|---|---|---|
| Links the current issue to the specified issue through the specified link type direction |
|
List<IssueLinkWithDirection>
issue.getIssueLinks(Long linkTypeId, String direction)
linkTypeId
: A number representing the link type id (e.g. 10300 ).
direction
: The link type direction (outward or inward)
List<IssueLinkWithDirection>
getLinkedIssues()
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.
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)
List<Issue>
getLinkedIssues(String linkType)
linkType
:
A 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)
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()
List<IssueLink>
getParentObject()
Returns the parent Issue, or null if the issue is not a subtask.
Issue
getPortfolioChildIssues()
List<Issue>
getPortfolioParent()
null
if the issue is not a child.Issue
getRemoteLinks(String ApplicationName)
ApplicationName
is null all the remote issue links are returned.applicationName
:
A string representing the remote link application name of a link type, as it appears on the Application Links pageCollection<RemoteIssueLink>
getStories()
List<Issue>
getSubTaskObjects()
Returns the subtasks of this issue, an empty collection if no subtasks
Collection<Issue>
Methods to link issues
linkIssue(String linkType, Issue destIssue)
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)
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)
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)
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
setFieldValue(String fieldNameOrId, Object value)
Sets the value of a system or custom field of the Issue object
Note |
---|
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
deleteEntityProperty(String propertyName)
propertyName
: A string representing the name of the Entity Propertyvoid
getEntityProperty(String propertyName)
setEntityProperty(String propertyName, Object 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)
propertyName
: A string representing the name of the Entity Property
jsonString:
A String representing the JSON string value to set.
void
view (e.g. blocks or is blocked by).
|
| ||
| Links the current issue to the issue with the specified issue key through the specified link type direction |
|
|
| Links the current issue to the specified issue through the specified link type id and direction. |
|
|
| Links the current issue to the issue with the specified issue key through the specified link type id and direction. |
|
|
Methods to set issue field value
Method | Description | Parameters | Return type | ||
---|---|---|---|---|---|
| Sets the value of a system or custom field of the Issue object
|
|
|
Methods to access issue properties
Method | Description | Parameters | Return type |
---|---|---|---|
| Deletes the specified Entity property of the issue. |
|
|
| The value of the specified Entity property of the issue, parsed into a Groovy object. | A string representing the name of a property | |
| Sets the value of the specified Entity property of the issue to a JSON representation of the specified value. |
|
|
| Sets the value of the specified Entity property of the issue to the specified JSON string. |
|
|
Methods to display message on issue view
showMessageToUser(String type, Boolean autoClose, String title, String body)
Description
Displays a message to the user, in the form of a "flag" in the top right corner of the screen. Testing this in the Groovy tester will not display the flag.
Parameters
Parameter name | Type | Description | Example |
---|---|---|---|
| The type of message to display: info, success, warning or error. Controls the color of the message box. |
| |
| Whether the message box should close automatically after a few seconds. |
| |
| The title of the message | Sample title | |
| The body of the message. Can contain HTML markup |
|
Return type
void
Examples
showMessageToUser(String type, String title, String body, String actionName, String actionType, String actionParam, Boolean inNewWindow)
Description
Displays a message to the user, in the form of a "flag" in the top right corner of the screen. The message will include an action link which, when clicked, will navigate to either a Jira issue or an arbitrary web page. Testing this in the Groovy tester will not display the flag.
Parameters
Parameter name | Type | Description | Example |
---|---|---|---|
| The type of message to display: info, success, warning or error. Controls the color of the message box. |
| |
| The title of the message | Sample title | |
| The body of the message. Can contain HTML markup | Sample body | |
| The title of the action link | Go to issue | |
| The type of action to perform when the user clicks on the link. Can be GOTO_ISSUE to navigate to a Jira issue, or GOTO_URL to navigate to an arbitrary web page. |
| |
| Either an issue key (for the GOTO_ISSUE action type) or a URL (for the GOTO_URL action type) |
| |
| Whether to open the issue or web page in a new browser window/tab. |
|
Return type
void
Examples
Other methods
| Description | Parameters | Return type |
---|---|---|---|
|
Adds the provided value as a new possible option to the mentioned field.
|
|
| |||
| Adds a remote issue link to the issue. | A |
RemoteIssueLink
For example: |
|
|
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 Id |
| |
|
| A string representing the field name or field Id | ||
| Retrieves a map of issue fields that have been modified during the current transition. | None | |
|
Returns the URL of the issue's customer request view. Only applies to Service Desk requests. Returns | None | ||
|
Returns the URL of the issue's View screen. | None |