You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 89
Next »
This document lists the expected result of a Groovy expression that should be provided to set Jira Standard and Custom fields. The easiest is to use the "Expected Value" tab of the Groovy editor help system. It lists the possible expected values for the selected Field
and Value Type
. This is applicable in contexts where you set a field value or comment an issue or write a conditional Groovy script. Select the Field
and Value Type as Set field value to Groovy expression
. Click on Expected Value.
The help editor displays the expected values for the selected field.
You might also want to look at Standard fields, Predefined custom fields, and User-created custom fields to know how to access the fields of an issue object.
On this page:
Field Name | Expected input type | Expected input value | Example |
---|
Affects Version/s | String
String[]
Version
| A Groovy expression that returns a: - String representing the name or id of a version.
- String with comma separated values that represent the names or ids (id takes precedence over the name) of the versions
- An array of strings that represent the names or ids (id takes precedence over the name) of the versions
- Single version object
- Collection of version objects
| "1.0" "1.0,2.0" ["1.0","2.0"] On creating a Bug set its Affects Version/s to the most recently released version - Set the Affects Version/s of the issue to Affects Version/s of all its linked issues
|
Assignee | String
ApplicationUser
| A Groovy expression that returns a: - String representing the username of a user
- object
| "carter" - Assign the issue to the Project lead, if the issue is unassigned on creation.
|
Components | String
String[]
ProjectComponent
Collection<ProjectComponent>
| A Groovy expression that returns a: - String representing the name or id of the component
- String with comma separated values that represent the names or ids (id takes precedence over the name) of the components
- An array of strings that represent the names or ids (id takes precedence over the name) of the components
- Single component object
- Collection of component objects
| - On creating an issue, pick the component of the issue from a cascading field that carries the Main and Sub-components
"C1,C2" ["C1","C2"]
- Set the Component/s of the issue to components whose lead is the current user
|
Description | String | A Groovy expression that returns a: - String representing a single line text.
- String representing a multi-line text
| "Issue associated to TEST-121" "Issues:\nFirst issue\nSecond issue"
On the creation of a sub-task add its summary to the description of its parent.
|
Due date | String
Timestamp
| A Groovy expression that returns a: | Set the due date to today's date - Set the due date to issue created plus five days.
|
Environment | String | A Groovy expression that returns a: - String representing a single line text
- String representing a multi-line text
| "QA" "1. QA\n2. Production"
|
Fix Version/s | String
String[]
Version
Collection<Version>
| A Groovy expression that returns a: - String representing the name or id of the version
- String with comma separated values that represent the names or ids (id takes precedence over the name) of the versions
- An array of strings that represent the names or ids (id takes precedence over the name) of the versions
- Single version object
- Collection of version objects
| |
Labels | String
Set<Label >
| A Groovy expression that returns a: - String representing a value
- String with space separated values
- An array of strings that represent values
- Set of labels
| "New"
["KB","How-to-do"] issue.get("Custom labels field")
|
Original Estimate | Long
String
| A Groovy expression that returns a - Number in Long
- Duration string
| |
Priority | String
Priority
| A Groovy expression that returns a: - String representing the name or id of the priority
- Priority object
| - "Blocker"
Set the priority of the issue to Highest if the issue belongs to the "Customer Portal" component On the creation of a Story, change its priority to that of the Epic if the Epic's priority is lower than the current priority of the Story
|
Remaining Estimate | Long
String
| A Groovy expression that returns a - Number in Long format representing the estimate in seconds
- Duration string
| 22400L "22400" issue.get("timespent")
"4w 2d 6h 40m"
|
Reporter | String
ApplicationUser
| A Groovy expression that returns a: - String representing the username of a user
- ApplicationUser object
| "carter" - Assign a reopened issue to the last person who commented it.
|
Resolution | String
Resolution
| A Groovy expression that returns a: - String representing the name or id of the resolution
- Resolution object.
| "Done" Set with the resolution the Epic resolution.
issue.getEpic?.get("resolution")
|
Security level |
Long
IssueSecurityLevel
| A Groovy expression that returns a: - String representing the name or id of the security level
- Number in Long format representing the id of the security level
- Security level
| "QA" or "10000"
10000L
Assign to the first security level of the project that can be set for an issue created in this project by the current user
|
Summary | String | A Groovy expression that returns a String representing a single line text | "Test of the web interface"
|
Time spent | Long
String
| A Groovy expression that returns a - Number in Long format representing the time spent in seconds
- Duration string
| 22400L "22400"
"4w 2d 6h 40m
|
Votes | String
String[]
ApplicationUser
Collection<ApplicationUser>
| A Groovy expression that returns a: - String representing the username of a user
- String with comma separated values that represent the usernames of the users.
- An array of strings that represent the usernames of the users
- Single ApplicationUser object
- Collection of ApplicationUser objects
| "charlie" "charlie,carter" ["charlie","carter"]
|
Watchers | String
String[]
ApplicationUser
Collection<ApplicationUser>
| A Groovy expression that returns a: - String representing the username of a user
- String with comma separated values that represent the usernames of the users.
- Single ApplicationUser object
- Collection of ApplicationUser objects
| "charlie" "charlie,carter" ["charlie","carter"] On the creation of a Story add the reporter of its Epic to the Watchers
|
Field Name | Expected input type | Expected input value | Examples |
---|
All Capture for JIRA fields | String | A Groovy expression that returns a: - String representing a single line text.
- String representing a multi-line text
| |
Raised during | String | A Groovy expression that returns a String representing the id of a session. | "10001" |
Field Name | Expected input type | Expected input value | Examples |
---|
Approvers | String
String[]
ApplicationUser
Collection<ApplicationUser>
| A Groovy expression that returns a: - String representing the username of a user
- String with comma separated values that represent the usernames of the users
- An array of strings that represent the usernames of the users
- Single ApplicationUser object
- Collection of ApplicationUser objects
| "carter" "djohn,carter" ["djohn","carter"] [issue.get("assignee")] issue.get("Watchers")
|
Customer Request Type | String | A Groovy expression that returns a: - String representing the Customer Request Type name
- String representing the Customer Request Type internal ID
| "IT help" "sd/desktoplaptopsupport"
|
Organizations | String
Set<String>
| A Groovy expression that returns a: - String representing the id of a Organization
- String with comma separated values that represent the ids of the Organizations
- An array of strings that represent the ids of the Organizations
| |
Request Participants | String
String[]
ApplicationUser
Collection<ApplicationUser>
| A Groovy expression that returns a: - String representing the username of a user
- String with comma separated values that represent the usernames of the users
- An array of strings that represent the usernames of the users
- Single ApplicationUser object
- Collection of ApplicationUser objects
| "carter" "jon,charlie" ["carter","djohn"] issue.get("assignee")
|
Field Name | Expected input type | Expected input value | Examples |
---|
Account | Tempo account object | A Groovy expression that returns a String representing the tempo account id. | "2"
|
Team | String | A Groovy expression that returns a String representing the id of the Tempo team. | "1" |
The value expected by custom fields depends on the Custom Field Type:
Custom field type | Expected input type | Expected input value | Examples |
---|
Checkboxes/Select List (multiple choices) | String
String[]
Option
Collection<Option>
| A Groovy expression that returns a: - String representing the option value or id (value takes precedence over the id)
- String with comma separated values that represent the values or ids (value takes precedence over the id) of options.
- An array of strings that represent the values or ids (value takes precedence over the id) of the options
- Option object
- Collection of option objects
| "10000" "Skype Installation,Eclipse Installation" ["Skype Installation","Eclipse Installation"] issue.get("Radio Buttons")
Auto select the installation tasks in a Task checklist after the Installations are done.
|
Radio buttons/Select List (single choice) | String
Option
| A Groovy expression that returns a: - String representing the option value or id (value takes precedence over the id)
- Option object
| "Hipchat Installation" issue.get("Checkboxes")?.first()?.getValue()
|
Select List (cascading) | String
Map<String, Option>
| A Groovy expression that returns a: - String representing the value or id of the parent
- String representing the value or id of the parent and value or id of the child in the format
<parent> - <child> - Map with two entries
null key: value or id or Option for the parent value"1" key: value or id or Option of the child
| "2" "1 - 1.1" [null:"O1", "1":issue.get("RB")]
|
Multi-level cascading select list | String
String[]
Option
Collection<Option>
| A Groovy expression that returns a: - A comma-separated list of option values, from parent to child:
- A comma-separated list of option IDs, from parent to child
- An array of option values, from parent to child
- An array of option IDs, from parent to child:
- An array of Option objects, from parent to child.
| "Parent 1,Child A,Child b" "10010,10011,10100" ["Parent 1","Child A","Child b"] [10010,10011,10100] issue.get("MLCS field")
|
Custom field type | Expected input type | Expected input value | Examples |
---|
Group Picker (single group) | String
Group
| A Groovy expression that returns a: - String representing the group name
- Group object
| |
Group Picker (multiple groups) | String
String[]
Group
Collection<Group >
| A Groovy expression that returns a: - String representing the group name
- String with comma separated values that represent the name of the groups
- An array of strings that represent the names of the groups
- Group object
- Collection of group objects
| "jira-administrators" "jira-administrators,jira-software-users"
["jira-administrators","jira-software-users"]
issue.get("Single group") - Update a custom multi-group picker field to all the groups the current user belongs to
|
Custom field type | Expected input type | Expected input value | Examples |
---|
Version Picker (single version) | String
Version
| A Groovy expression that returns a: - String representing the id of a version.
- Single version object
| "10000" This code snippet returns the first Fix Version/s
issue.get("fixVersions")?.first()
|
Version Picker (multiple versions) | String
String[]
Version
Collection<Version>
| A Groovy expression that returns a: - String representing the id of a version.
- String with comma separated values that represent the ids of the versions
- An array of strings that represent the ids of the versions
- Single version object
- Collection of version objects
| "10000" "10000,10010" ["10000","10010" ] This code snippet returns the last Affects Version/s
issue.get("versions")?.last()
This code snippet returns the Fix Version/s
|
Text
Custom field type | Expected input type | Expected input value | Examples |
---|
Text Field (single line) | String | A Groovy expression that returns a String representing a single-line text. | "Test of a credit card issue screen" issue.get("summary")
|
Text Field (multi line) | String | A Groovy expression that returns a String representing a multi-line text. | "Add the post-function\nPlace it at the end" issue.get("description")
|
Custom field type | Expected input type | Expected input value | Examples |
---|
Project Picker (single project) | String
Project
| A Groovy expression that returns a: - String representing the project id or name or key
- Project object
| "10000" "TEST"
|
Labels | String
Set<Label>
| A Groovy expression that returns a: - String representing a value
- String with space separated values
- An array of strings that represent values
- Set of labels
| "New" "KB How-to-do" ["KB","How-to-do"] issue.get("Labels")
|
URL Field | String | A Groovy expression that returns a String representing a URL. | "https://innovalog.com" |
Number Field | String
Double
| A Groovy expression that returns a: - String containing a number
- Number in Double format.
| |