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 7 Next »

When you create a script (Groovy or BeanShell), for example in a condition for a post-function or in a Calculated Field, you can use issue.get(<field_name>) to get the value of an Issue field, where <field_name> can be either the name of a JIRA standard field or the internal name of a custom field.

Custom Fields

In the case of a custom field, <field_name> has the form customfield_xxxxx, where xxxxx is the custom field numerical ID, as seen in the URL when editing the field. Or, starting with JIRA Misc Custom Fields v1.6.2 or JIRA Misc Workflow Extensions v. 3.7.0, you can also use the "real name" of the custom field (as shown in the list of custom fields).

The type of the return value of issue.get(...) depends on the type of the custom field you are accessing. The following table shows the return type for standard custom field types (provided by JIRA):

Field TypeReturn TypeComments
Checkboxes
Collection<com.atlassian.jira.issue.customfields.option.Option>
 
Date Picker
java.util.Date
 
Date Time Picker
java.util.Date
 
Labels
Set<com.atlassian.jira.issue.label.Label>
 
Number Field
Double
 
Radio Buttons
com.atlassian.jira.issue.customfields.option.Option
 
Select List (cascading)
Map<String, com.atlassian.jira.issue.customfields.option.Option>

The key in the map represents the field depth of the select list. A key of null is the first level, and a key of "1" (the string "1") is the second level select list.

Select List (multiple choices)
Collection<com.atlassian.jira.issue.customfields.option.Option>
 
Select List (single choice)
com.atlassian.jira.issue.customfields.option.Option
 
Text Field (multi line)
String
 
Text Field (single line)
String
 
URL Field
String
 
User Picker (single user)
com.atlassian.crowd.embedded.api.User or
com.atlassian.jira.user.ApplicationUser (depending on JIRA version)
 

A lot more custom field types might be available on your JIRA instance, based on the plugins you have installed. The following table shows the return type for the most common "advanced" custom field types:

Field TypeReturn Type
Group Picker (multiple groups)Collection<com.atlassian.crowd.embedded.api.Group>
Group Picker (single group)
com.atlassian.crowd.embedded.api.Group
Project Picker (single project)
org.ofbiz.core.entity.GenericValue or com.atlassian.jira.project.Project (depending on JIRA version)
User Picker (multiple users)
Collection<com.atlassian.crowd.embedded.api.User> or Collection<com.atlassian.jira.user.ApplicationUser> (depending on JIRA version)
Version Picker (multiple versions)
Collection<com.atlassian.jira.project.version.Version>
Version Picker (single version)
com.atlassian.jira.project.version.Version

Standard Fields

In the case of standard fields, <field_name>  can be one of the following strings:

field namereturnsdescription
attachment

Collection<com.atlassian.jira.issue.attachment.Attachment>

 the collection of attachments to the issue
versions

Collection<com.atlassian.jira.project.version.Version>

the Affects Version/s field
comment

List<com.atlassian.jira.issue.comments.Comment>

a list of all comments for the issue
components

Collection<com.atlassian.jira.bc.project.component.ProjectComponent>

 
fixVersions

Collection<com.atlassian.jira.project.version.Version>

 
issuetype

com.atlassian.jira.issue.issuetype.IssueType

 
issuelinks

List<com.atlassian.jira.issue.link.IssueLink>

a list of all inward and outward links
workratio

String

 
issuekey

String

 
subtasks

Collection<com.atlassian.jira.issue.Issue>

 
priority

com.atlassian.jira.issue.priority.Priority

 
resolution

com.atlassian.jira.issue.resolution.Resolution

 
status

com.atlassian.jira.issue.status.Status

 
project
com.atlassian.jira.project.Project 
security

Long

security level ID
timeestimate
Long   
timeoriginalestimate
Long   
timespent
Long   
aggregatetimespent
Long   
aggregatetimeestimate
Long   
aggregatetimeoriginalestimate
Long   
assignee
com.atlassian.crowd.embedded.api.User or
com.atlassian.jira.user.ApplicationUser (depending on JIRA version)
 
reporter
com.atlassian.crowd.embedded.api.User or
com.atlassian.jira.user.ApplicationUser (depending on JIRA version)
 
description
String 
environment

String

 
summary
String 
duedate
java.sql.Timestamp 
updated
java.sql.Timestamp 
created
java.sql.Timestamp 
resolutiondate
java.sql.Timestamp 
labels
Set<com.atlassian.jira.issue.label.Label> 
watches

Collection<com.atlassian.crowd.embedded.api.User> or

Collection<com.atlassian.jira.user.ApplicationUser> (depending on JIRA version)
 

 

Filter by label

There are no items with the selected labels at this time.

  • No labels