changes.mady.by.user David Fischer
Saved on Jul 02, 2017
changes.mady.by.user Radhika Vijji.
Saved on Jul 03, 2017
...
Field name: Component/s
Component/s
Field ID: components
components
Description: The Component/s field is a collection of objects. Each object represents one component.
get("components") or get("Component/s")
Collection<ProjectComponent
Example: First component name:
issue.get("components")?.first()?.getName()
getAsString("Component/s") or getAsString("components") that returns a String with comma separated component names:
getAsString("Component/s") or getAsString("components")
String
Examples: All the components of the issue
issue.getAsString("components")
getComponentObjects() that returns a Collection<ProjectComponent>
getComponentObjects()
Example:Last component description:
if(issue.getComponentObjects()) { issue.getComponentObjects().last().getDescription() }
Field name: Epic
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
getEpic()
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()
Field name: Issue Links
Issue Links
Field ID: issuelinks
issuelinks
Description: Issue links is a list of objects. Each object represents one issue link.
Accessing the Issue links field: You can access the Issue links field using any of the following getters of the Issue interface:
get("issuelinks") or get("Linked Issues")
List<IssueLink>
Example: Get the issue links of the current issue
issue.get("issuelinks")
getInwardIssueLinks()
Example: Number of inward linked issues for the current issue
issue.getInwardIssueLinks().size()
getOutwardIssueLinks()
Example: Destination issue of the first issue link to the current issue
if(issue.getOutwardIssueLinks()) { issue.getOutwardIssueLinks().first().getDestinationObject() }
getLinkedIssues(String linkName)
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
Field name: Parent
Parent
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
getParentObject()
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()
Field name: Stories
Stories
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>
getStories()
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()
Field name: Log Work
Log Work
Field ID: worklog
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>
get("worklog") or get("Log Work")
List<Worklog>
Example: Time spent on the last work logged
if(issue.get("Log Work")) { issue.get("Log Work").last().getTimeSpent() }