This page explains how to access the value of Pre-defined custom fields using Groovy. You can access them using the getters of the Issue interface. To understand how to write values into the writable custom fields see Raw value/text input for fields and Groovy expression input for fields.
...
...
Panel |
---|
|
Customer Request Type |
Panel |
---|
|
To get the Customer Request Type name as displayed on the issue view, you can use the following snippet: Code Block |
---|
language | groovy |
---|
linenumbers | true |
---|
| import com.atlassian.servicedesk.api.requesttype.RequestTypeService
def requestTypeService = getComponent(RequestTypeService)
def sourceIssueRequestTypeQuery = requestTypeService.newQueryBuilder().issue(issue.id).build()
def requestTypeEither = requestTypeService.getRequestTypes(currentUser, sourceIssueRequestTypeQuery)
if (requestTypeEither.isLeft()) {
log.warn "${requestTypeEither.left().get()}"
return false
}
return requestTypeEither.right.results[0].name |
|
...
Panel |
---|
|
SatisfactionField name: Satisfaction Description: The Satisfaction field is an object describing the request feedback in Service Desk requests. Accessing the Satisfaction field: You can access the Satisfaction field using any of the following getters of the Issue interface:
|
...
Panel |
---|
|
Time to resolutionField name: Time to resolution Description: The Time to resolution field is an object representing a SLA value. Accessing the Time to resolution field: You can access the Time to resolution field using any of the following getters of the Issue interface:
|
Portfolio for Jira fields
Panel |
---|
|
Parent Link- Field Name: Parent Link
Description: The Parent link field is an object representing the Initiative of the current Epic. It returns com.atlassian.rm.jpo.env.issues. JiraIssueService$3SimpleIssueAttributes. Accessing the Parent Link field: You can access the Parent Link field using getAsString("Parent Link") or getAsString("customfield_xxxxx") that returns a String representing the key of the Initiative the Epic belongs to.
|
...