---
title: "Groovy expression input for fields"
canonical: "https://support.appfire.com/space/JMWE/461767383/Groovy%20expression%20input%20for%20fields"
format: markdown
---
> Macro (aura-html)

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](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461897846) system. It <span style="color: #091e42">lists the possible expected values for the selected</span><span style="color: #091e42"> </span>`Field`<span style="color: #091e42"> </span><span style="color: #091e42">and</span><span style="color: #091e42"> </span>`Value Type`<span style="color: #091e42">. This is applicable in contexts where you set a field value or comment an issue or write a conditional Groovy script. Select the</span><span style="color: #091e42"> </span>`Field`<span style="color: #091e42"> </span><span style="color: #091e42">and</span><span style="color: #091e42"> </span>`Value Type as Set field value to Groovy expression`<span style="color: #091e42">. Click on</span>` ``Expected Value.`<span style="color: #091e42"> </span><span style="color: #091e42">The help editor displays the expected values for the selected field.</span>

<span style="color: #000000">Y</span><span style="color: #000000">ou might also want to look at </span>[<span style="color: #000000">Standard fields</span>](https://appfire.atlassian.net/wiki/display/JMWE/Standard+JIRA+fields)<span style="color: #000000">, </span>[<span style="color: #000000">Predefined custom fields</span>](https://appfire.atlassian.net/wiki/display/JMWE/Pre-defined+custom+fields)<span style="color: #000000">, and </span>[<span style="color: #000000">User-created custom fields</span>](https://appfire.atlassian.net/wiki/display/JMWE/Pre-defined+custom+fields)<span style="color: #000000"> to know how to access the fields of an issue object.</span>

**On this page:**


# <span style="color: #000000">Standard Jira fields</span>

| <span style="color: #000000">** Field Name**</span> | **Expected input type** | <span style="color: #000000">**Expected input value**</span> | <span style="color: #000000">**Example**</span> |
| --- | --- | --- | --- |
| <span style="color: #000000">Affects Version/s</span> | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`[]`<br>[Version](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461538137)<br>[Collection](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html)`<`[Version](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461538137)`>` | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. String representing the *name* or *id* of a version.
2. String with comma separated values that represent the *names* or *ids (**i**d** *<span style="color: #000000">takes precedence over the</span><span style="color: #000000">* *</span>*name)* of the versions
3. An array of strings that represent the *names* or *ids** (**i**d** *<span style="color: #000000">takes precedence over the</span><span style="color: #000000">* *</span>*name)* of the versions
4. Single version object
5. Collection of version objects | 1. `"1.0"`
2. `"1.0,2.0"`
3. `["1.0","2.0"]`
4. [On creating a Bug set its Affects Version/s to the most recently released version](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-OncreatingaBugsetitsAffectsVersion/stothemostrecentlyreleasedversion)
5. [Set the Affects Version/s of the issue to Affects Version/s of all its linked issues](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-SettheAffectsVersion/softheissuetoAffectsVersion/sofallitslinkedissues) |
| Assignee | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. <span style="color: #000000">String representing the </span>*<span style="color: #000000">username</span>*<span style="color: #000000"> of a u</span>ser
2. ApplicationUser object | 1. `"carter"`
2. [Assign the issue to the Project lead, if the issue is unassigned on creation](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-AssigntheissuetotheProjectlead,iftheissueisunassignedoncreation). |
| <span style="color: #000000">Components</span> | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`[]`<br>[ProjectComponent](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462062256)<br>[Collection](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html)`<`[ProjectComponent](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462062256)`>` | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. String representing the *name* or *id* of the component
2. String with comma separated values that represent the *names* or *ids** (**i**d** *<span style="color: #000000">takes precedence over the</span><span style="color: #000000">* *</span>*name)* of the components
3. An array of strings that represent the *names* or *ids** (**i**d** *<span style="color: #000000">takes precedence over the</span><span style="color: #000000">* *</span>*name)* of the components
4. Single component object
5. Collection of component objects | 1. [On creating an issue, pick the component of the issue from a cascading field that carries the Main and Sub-components](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-Oncreatinganissue,pickthecomponentoftheissuefromacascadingfieldthatcarriestheMainandSub-components)
2. `"C1,C2"`
3. `["C1","C2"]`
4. 
5. [Set the Component/s of the issue to components whose lead is the current user](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-SettheComponent/softheissuetocomponentswhoseleadisthecurrentuser) |
| Description | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. String representing a single line text.
2. String representing a multi-line text | 1. `"Issue associated to TEST-121"`
2. `"Issues:\nFirst issue\nSecond issue"`
3. [On the creation of a sub-task add its summary to the description of its parent](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-Onthecreationofasub-taskadditssummarytothedescriptionofitsparent). |
| Due date | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Timestamp](http://docs.oracle.com/javase/7/docs/api/java/sql/Timestamp.html) | <span style="color: #000000">A Groovy expression that returns a:</span><br>- String representing a timestamp in the [format](http://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html) specified in [Jira system settings](https://confluence.atlassian.com/adminjiraserver073/configuring-the-look-and-feel-of-your-jira-applications-861253125.html#ConfiguringthelookandfeelofyourJIRAapplications-Howtochangedateandtimeformats)*.*
- [Timestamp](http://groovy%20expression%20that%20returns/) object | 1. [Set the due date to today's date](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-Settheduedatetotoday&#39;sdate)
2. [Set the due date to issue created plus five days](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-Settheduedatetoissuecreatedplusfivedays). |
| Environment | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. <span style="color: #000000">String representing a single line text</span>
2. String<span style="color: #000000"> representing a </span>multi-line<span style="color: #000000"> text</span> | 1. `"QA"`
2. `"1. QA\n2. Production"` |
| <span style="color: #000000">Fix Version/s</span> | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`[]`<br>[Version](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461538137)<br>[Collection](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html)`<`[Version](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461538137)`>` | A Groovy expression that returns a:<br>1. String representing the *name* or *id* of the version
2. String with comma separated values that represent the *names* or *ids **(**i**d** *<span style="color: #000000">takes precedence over the</span><span style="color: #000000">* *</span>*name)** * of the versions
3. An array of strings that represent the *names* or *ids **(**i**d** *<span style="color: #000000">takes precedence over the</span><span style="color: #000000">* *</span>*name)** * of the versions
4. Single version object
5. Collection of version objects | 1. [On creating a Bug with High priority fix it in the upcoming release](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-OncreatingaBugwithHighprioritysetitsFixVersion/stotheupcomingrelease).
2. `"1.0,2.0"`
3. `["1.0","2.0"]`
4. [Assign to an unreleased version whose release date is nearest to the issue's due date](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-Assigntoanunreleasedversionwhosereleasedateisnearesttotheissue&#39;sduedate) |
| <span style="color: #000000">Issue type</span> | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Long](http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html)<br>[IssueType](https://appfire.atlassian.net/wiki/x/9gSnB) | > ⚠️ **Use with caution!**
> ⚠️ 
> ⚠️ Changing the issue type should only be done if the current and new issue types share the same workflow, or if the issue's Status exists in both the current and new workflow. Otherwise, the operaton will fail.
> ⚠️ 
> ⚠️ Also, when changing the issue type of the current issue, make sure to move the post-function below the "Set issue status to the linked status of the destination workflow step" built-in post-function.<br><span style="color: #000000">A Groovy expression that returns a:</span><br>1. <span style="color: #172b4d">String representing a valid issue type name</span>
2. <span style="color: #172b4d">Number representing a valid issue type ID</span>
3. <span style="color: #172b4d">IssueType object.</span> | 1. `"``Bug"`
2. `10020`
3. `issue.issuetype` |
| Labels | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Set](http://docs.oracle.com/javase/7/docs/api/java/util/Set.html)`<`[Label](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462160018)`>` | <span style="color: #000000">A Groovy expression that returns a: </span><br>1. String representing a value
2. String with space separated values
3. An array of strings that represent values
4. Set of labels | 1. `"New"`
2. `"KB How-to-do"`
3. `["KB","How-to-do"]`
4. `issue.get("Custom labels field")` |
| Original Estimate | [Long](http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns a </span><br>1. <span style="color: #000000">N</span>umber in [Long](http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html) format representing the estimate in seconds
2. Duration string | - `"36000"`
- `"3w 4d 5h"`
- [Set the Original estimate of the issue to the difference of its creation date and Due date](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-SettheOriginalestimateoftheissuetothedifferenceofitscreationdateandDuedate) |
| Priority | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Priority](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462159986) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. String representing the *name* or *id* of the priority
2. Priority object | 1. "Blocker"
2. [Set the priority of the issue to Highest if the issue belongs to the "Customer Portal" component](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-SetthepriorityoftheissuetoHighestiftheissuebelongstothe&quot;CustomerPortal&quot;component)
3. [<span style="color: #707070">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</span>](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-OnthecreationofaStory,changeitsprioritytothatoftheEpiciftheEpic&#39;spriorityislowerthanthecurrentpriorityoftheStory.) |
| Remaining Estimate | [Long](http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns a </span><br>1. <span style="color: #000000">N</span>umber in [Long](http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html) format representing the estimate in seconds
2. Duration string | - `22400L`
- `"22400"`
- `issue.get("timespent")`
- `"4w 2d 6h 40m"` |
| Reporter | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. <span style="color: #000000">String representing the </span>*<span style="color: #000000">username</span>*<span style="color: #000000"> of a u</span>ser
2. ApplicationUser object | 1. `"carter"`
2. [Assign a reopened issue to the last person who commented it](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-Assignareopenedissuetothelastpersonwhocommentedit). |
| Resolution | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Resolution](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461406520) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. String representing the *name* or *id* of the resolution
2. Resolution object<span style="color: #000000">.</span> | 1. `"Done"`
2. Set with the resolution the Epic resolution. |
| Security level | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Long](http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html)<br>[IssueSecurityLevel](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461963728) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. String representing the *name* or *id* of the security level
2. <span style="color: #000000">N</span>umber in [Long](http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html) format representing the *id* of the security level
3. Security level | 1. `"QA" `or` "10000"`
2. `10000L`
3. [Assign to the first security level of the project that can be set for an issue created in this project by the current user](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-Assigntothefirstsecurityleveloftheprojectthatcanbesetforanissuecreatedinthisprojectbythecurrentuser) |
| Summary | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns a </span><span style="color: #000000">String representing a single line text</span> | `"Test of the web interface"` |
| Time spent | [Long](http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns a </span><br>1. <span style="color: #000000">N</span>umber in [Long](http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html) format representing the time spent in seconds
2. Duration string | 1. `22400L`
2. `"22400"`
3. `"4w 2d 6h 40m` |
| Votes | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`[]`<br>[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599)<br>[Collection](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html)`<`[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599)`>` | A Groovy expression that returns a:<br>1. String representing the u*sername* of a user
2. String with comma separated values that represent the *usernames* of the users.
3. An array of strings that represent the *usernames* of the users
4. Single ApplicationUser object
5. Collection of ApplicationUser objects | 1. `"charlie"`
2. `"charlie,carter"`
3. `["charlie","carter"]` |
| Watchers | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`[]`<br>[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599)<br>[Collection](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html)`<`[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599)`>` | A Groovy expression that returns a:<br>1. String representing the u*sername* of a user
2. String with comma separated values that represent the *usernames* of the users.
3. An array of strings that represent the *usernames* of the users
4. Single ApplicationUser object
5. Collection of ApplicationUser objects | 1. `"charlie"`
2. `"charlie,carter"`
3. `["charlie","carter"]`
4. [On the creation of a Story add the reporter of its Epic to the Watchers](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-OnthecreationofaStoryaddthereporterofitsEpictotheWatchers) |

# Pre-defined custom fields

## Capture for JIRA fields

| <span style="color: #000000">** Field Name**</span> | **Expected input type** | <span style="color: #000000">**Expected input value**</span> | <span style="color: #000000">**Examples**</span> |
| --- | --- | --- | --- |
| <span style="color: #000000">All Capture for JIRA fields</span> | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. <span style="color: #000000">String representing a single line text.</span>
2. <span style="color: #000000">String representing a multi-line text</span> | - `issue.get("environment")` |
| <span style="color: #000000">Raised during</span> | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns a String representing the </span>*<span style="color: #000000">id</span>*<span style="color: #000000"> of a session.</span> | `"10001"` |

## Jira Software fields

| <span style="color: #000000">** Field Name**</span> | **Expected input type** | <span style="color: #000000">**Expected input value**</span> | <span style="color: #000000">**Examples**</span> |
| --- | --- | --- | --- |
| <span style="color: #000000">Epic Color</span> | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns a String representing the color of the Epic.</span> | `"ghx-label-6"` |
| <span style="color: #000000">Epic Link</span> | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression returning a String representing the </span>*<span style="color: #000000">key </span>*<span style="color: #000000">of an Epic.</span> | "TEST-34"  
[Epic has a Story and the task has a sub-task. When the sub-task is reopened we create a bug in another project linking it to the sub-task. On creation of the Bug, set the Epic link field value to the same field of the Task](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-EpichasaStoryandthetaskhasasub-task.Whenthesub-taskisreopenedwecreateabuginanotherprojectlinkingittothesub-task.OncreationoftheBug,settheEpiclinkfieldvaluetothesamefieldoftheTask) |
| Epic Name | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns a String representing the name of the Epic.</span> | - `"Creation of a new issue"`
- `issue.get("summary")` |
| Epic Status | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns a String representing the </span>*<span style="color: #000000">value</span>*<span style="color: #000000"> of the Epic status.</span> |  |
| Sprint | [Long](http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html)<br>[Sprint](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461439779)<br>[Sprint](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461439779)`[]` | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. String representing the *id *of a Sprint
2. String with comma separated values that represent the *ids *of the Sprints
3. An array of strings that represent the *ids *of the Sprints
4. Single [Sprint](https://docs.atlassian.com/jira-software/6.0.7/com/atlassian/greenhopper/service/sprint/package-summary.html) object
5. Collection of [Sprint](https://docs.atlassian.com/jira-software/6.0.7/com/atlassian/greenhopper/service/sprint/package-summary.html) objects | 1. `"1"`
2. `"1,2"`
3. `["1","2"]`
4. `issue.getEpic()?.get("Sprint")` |
| <span style="color: #000000">Status</span> | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Long](http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html)<br>[Status](https://appfire.atlassian.net/wiki/x/DRinB) | > ⚠️ **Use with caution!**
> ⚠️ 
> ⚠️ Changing the Status of an issue is normally done only through an issue transition. Changing the Status field value directly will not validate potentially required fields (such as the Resolution field), and will leave no trace in the issue history. This should be used only in specific cases.
> ⚠️ 
> ⚠️ Also, when changing the Status of the current issue, make sure to move the post-function below the "Set issue status to the linked status of the destination workflow step" built-in post-function.
> ⚠️ 
> ⚠️ Finally, the Status field cannot be set during a Create transition.<br><span style="color: #000000">A Groovy expression that returns a:</span><br>1. <span style="color: #172b4d">String representing a valid status name</span>
2. <span style="color: #172b4d">Number representing a valid status ID</span>
3. <span style="color: #172b4d">Status object.</span> | 1. `"``Open"`
2. `10000`
3. `issue.get("status").name` |
| Story points | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Double](http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html) | A Groovy expression that returns a:<br>1. String containing a number
2. Number in [Double](http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html) format. | 1. `"10"`
2. `5d`
3. `"25.6"` |

## Jira Service Desk fields

| <span style="color: #000000">** Field Name**</span> | **Expected input type** | <span style="color: #000000">**Expected input value**</span> | <span style="color: #000000">**Examples**</span> |
| --- | --- | --- | --- |
| Approvers | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`[]`<br>[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599)<br>[Collection](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html)`<`[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599)`>` | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. String representing the *username* of a user
2. String with comma separated values that represent the *usernames* of the users
3. An array of strings that represent the *usernames* of the users
4. Single ApplicationUser object
5. Collection of ApplicationUser objects | 1. `"carter"`
2. `"djohn,carter"`
3. `["djohn","carter"]`
4. `[issue.get("assignee")]`
5. `issue.get("Watchers")` |
| Customer Request Type | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | A Groovy expression that returns a:<br>- String representing the Customer Request Type name
- String representing the Customer Request Type internal ID | - `"IT help"`
- `"sd/desktoplaptopsupport"` |
| Organizations | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Set](http://docs.oracle.com/javase/7/docs/api/java/util/Set.html)`<`[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`>` | <span style="color: #000000">A Groovy expression that returns a:</span><br>- <span style="color: #000000">String representing the </span>*<span style="color: #000000">name</span>*<span style="color: #000000"> of an Organization</span>
- <span style="color: #000000">String representing the </span>*<span style="color: #000000">id</span>*<span style="color: #000000"> of an Organization</span>
- <span style="color: #000000">String </span>with comma-separated values that represent the *names *of the Organizations
- String with comma-separated values that represent the *ids *of the Organizations
- An array of strings that represent the *names *of the Organizations
- An array of strings that represent the *ids *of the Organizations | - `"Acme, Inc."`
- `"1"`
- `"Acme,Apple"`
- `"1,33"`
- ["Acme, Inc.", "Apple"]
- `["1","33"]` |
| <span style="color: #000000">Request Participants</span> | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`[]`<br>[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599)<br>[Collection](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html)`<`[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599)`>` | <span style="color: #000000">A Groovy expression that returns a:</span><br>- 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")` |

## Por<span style="color: #000000">tfolio for Jira fields</span>

| <span style="color: #000000">** Field Name**</span> | **Expected input type** | <span style="color: #000000">**Expected input value**</span> | <span style="color: #000000">**Examples**</span> |
| --- | --- | --- | --- |
| <span style="color: #000000">Parent Link</span> | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression returning a String representing the</span><span style="color: #000000"> </span>*<span style="color: #000000">key</span>**<span style="color: #000000"> </span>*<span style="color: #000000">of an Initiative.</span><br>**<span style="color: #000000">Note:</span>**<span style="color: #000000"> You can use this field to create a link (Jira Portfolio Parent Link) from Epic to Initiative</span> | `"KP-9"` |

## Tempo fields

| <span style="color: #000000">** Field Name**</span> | **Expected input type** | <span style="color: #000000">**Expected input value**</span> | <span style="color: #000000">**Examples**</span> |
| --- | --- | --- | --- |
| <span style="color: #000000">Account</span> | [Tempo account object](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461439563)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Long](http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html) | <span style="color: #000000">A Groovy expression that returns either:</span><br>- a [Tempo account object](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461439563)
- a  [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)` `representing either the Account **Key** or the account **Name**
- a [Long](http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html) representing the Account **ID** | - `"ACCOUNT1"`
- `"Account 1"`
- `23` |
| <span style="color: #000000">Team</span> | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns </span><span style="color: #000000">a String representing the</span><span style="color: #000000"> </span>*<span style="color: #000000">id</span>*<span style="color: #000000"> of the Tempo team.</span> | `"1"` |

# User-created custom fields

<span style="color: #000000">The value expected by custom fields depends on the Custom Field Type:</span>

## Select list type

| <span style="color: #000000">**Custom field type**</span> | **Expected input type** | <span style="color: #000000">**Expected input value**</span> | <span style="color: #000000">**Examples**</span> |
| --- | --- | --- | --- |
| Checkboxes/Select List (multiple choices) | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`[]`<br>[Option](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462160057)<br>[Collection](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html)`<`[Option](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462160057)`>` | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. <span style="color: #000000">String representing the option </span>*<span style="color: #000000">value </span>*<span style="color: #000000">or</span>*<span style="color: #000000"> id</span>*<span style="color: #000000"> (</span>*<span style="color: #000000">value</span>*<span style="color: #000000"> </span><span style="color: #000000">takes precedence over the</span><span style="color: #000000"> </span>*<span style="color: #000000">id</span>*<span style="color: #000000">)</span>
2. String with comma separated values that represent the *values* or *ids* <span style="color: #000000">(</span>*value*<span style="color: #000000"> </span><span style="color: #000000">takes precedence over the</span><span style="color: #000000"> </span>*id*<span style="color: #000000">) </span>of options.
3. An array of strings that represent the *values* or *ids* <span style="color: #000000">(</span>*value*<span style="color: #000000"> </span><span style="color: #000000">takes precedence over the</span><span style="color: #000000"> </span>*id*<span style="color: #000000">) </span>of the options
4. Option object
5. Collection of option objects | 1. `"10000"`
2. `"Skype Installation,Eclipse Installation"`
3. `["Skype Installation","Eclipse Installation"]`
4. `issue.get("Radio Buttons")`
5. [Auto select the installation tasks in a Task checklist after the Installations are done](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-AutoselecttheinstallationtasksinaTaskchecklistaftertheInstallationsaredone). |
| Radio buttons/Select List (single choice) | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Option](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462160057) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. <span style="color: #000000">String representing the option </span>*value *or* id *<span style="color: #000000">*(*</span>*value*<span style="color: #000000">* *</span><span style="color: #000000">*takes precedence over the*</span><span style="color: #000000">* *</span>*id*<span style="color: #000000">*)*</span>
2. Option object | 1. `"Hipchat Installation"`
2. `issue.get("Checkboxes")?.first()?.getValue()` |
| Select List (cascading) | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Map](http://docs.oracle.com/javase/7/docs/api/java/util/Map.html)`<`[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`, `[Option](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462160057)`>` | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. <span style="color: #000000">S</span>tring representing the *value* or *id* of the parent
2. String representing the *value* or *id* of the parent and *value* or *id* of the child in the format `<parent> - <child>`
3. Map with two entries
  1. `null` key: *value* or *id* or [Option](https://developer.atlassian.com/static/javadoc/jira/reference/com/atlassian/jira/issue/customfields/option/Option.html) for the parent value
  2. `"1"` key: *value* or *id* or [Option](https://developer.atlassian.com/static/javadoc/jira/reference/com/atlassian/jira/issue/customfields/option/Option.html) of the child | 1. `"2"`
2. `"1 - 1.1"`
3. `[null:"O1", "1":issue.get("RB")]` |
| [Multi-level cascading select list](https://marketplace.atlassian.com/apps/5008/multi-level-cascading-select) | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`[]`<br>[Option](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462160057)<br>[Collection](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html)`<`[Option](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462160057)`>` | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. A comma-separated list of option values, from parent to child:
2. A comma-separated list of option IDs, from parent to child
3. An array of option values, from parent to child
4. An array of option IDs, from parent to child:
5. An array of Option objects, from parent to child. | 1. `"Parent 1,Child A,Child b"`
2. `"10010,10011,10100"`
3. `["Parent 1","Child A","Child b"]`
4. `[10010,10011,10100]`
5. `issue.get("MLCS field")` |

## Group picker

| <span style="color: #000000">**Custom field type**</span> | **Expected input type** | <span style="color: #000000">**Expected input value**</span> | <span style="color: #000000">**Examples**</span> |
| --- | --- | --- | --- |
| Group Picker (single group) | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Group](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461406552) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. <span style="color: #000000">String representing the group </span>*<span style="color: #000000">name</span>*
2. <span style="color: #000000">Group object</span> | - `"jira-administrators"`
- [Update a custom group picker field to the first group the assignee belongs to](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-Updateacustomgrouppickerfieldtothefirstgrouptheassigneebelongsto). |
| Group Picker (multiple groups) | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`[]`<br>[Group](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461406552)<br>[Collection](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html)`<`[Group](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461406552)`>` | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. <span style="color: #000000">String representing the group </span>*<span style="color: #000000">name</span>*
2. String with comma separated values that represent the *name* of the groups
3. An array of strings that represent the *names *of the groups
4. Group object
5. Collection of group objects | 1. `"jira-administrators"`
2. `"jira-administrators,jira-software-users"`
3. `["jira-administrators","jira-software-users"]`
4. `issue.get("Single group")`
5. [Update a custom multi-group picker field to all the groups the current user belongs to](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-Updateacustommulti-grouppickerfieldtoallthegroupsthecurrentuserbelongsto) |

## User picker

| <span style="color: #000000">**Custom field type**</span> | **Expected input type** | <span style="color: #000000">**Expected input value**</span> | <span style="color: #000000">**Examples**</span> |
| --- | --- | --- | --- |
| User Picker (multiple users) | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`[]`<br>[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599)<br>[Collection](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html)`<`[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599)`>` | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. <span style="color: #000000">String representing the </span>*<span style="color: #000000">username</span>*
2. String with comma separated values that represent the *usernames* of the users
3. An array of strings that represent the *usernames *of the users
4. Single ApplicationUser object
5. Collection of ApplicationUser objects | 1. `"carter"`
2. `"carter,djohn"`
3. `["carter",djohn"]`
4. `issue.get("assignee")`
5. [On creating an issue, Copy the component leads of the selected components to a Multi-user picker field](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-Oncreatinganissue,CopythecomponentleadsoftheselectedcomponentstoaMulti-userpickerfield) |
| User Picker (single user) | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. <span style="color: #000000">String representing the </span>*<span style="color: #000000">username</span>*
2. ApplicationUser object | 1. `"carter"`
2. [Save the author of the "Approve" transition in a custom single-user picker field](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-Savetheauthorofthe&quot;Approve&quot;transitioninacustomsingle-userpickerfield) |

## Version picker

| <span style="color: #000000">**Custom field type**</span> | **Expected input type** | <span style="color: #000000">**Expected input value**</span> | <span style="color: #000000">**Examples**</span> |
| --- | --- | --- | --- |
| Version Picker (single version) | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Version](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461538137) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. String representing the *id *of a version.
2. Single version object | 1. `"10000"`
2. This code snippet returns the first Fix Version/s |
| Version Picker (multiple versions) | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`[]`<br>[Version](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461538137)<br>[Collection](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html)`<`[Version](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461538137)`>` | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. String representing the *id *of a version.
2. String with comma separated values that represent the *ids* of the versions
3. An array of strings that represent the *ids* of the versions
4. Single version object
5. Collection of version objects | 1. `"10000"`
2. `"10000,10010"`
3. `["10000","10010" ]`
4. This code snippet returns the last Affects Version/s
5. This code snippet returns the Fix Version/s |

## Text

| <span style="color: #000000">**Custom field type**</span> | **Expected input type** | <span style="color: #000000">**Expected input value**</span> | <span style="color: #000000">**Examples**</span> |
| --- | --- | --- | --- |
| Text Field (single line) | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns a </span><span style="color: #000000">String representing a single-line text.</span> | - `"Test of a credit card issue screen"`
- `issue.get("summary")` |
| Text Field (multi line) | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns a </span><span style="color: #000000">String representing a multi-line text.</span> | - `"Add the post-function\nPlace it at the end"`
- `issue.get("description")` |

## Date/Time picker

| <span style="color: #000000">**Custom field type**</span> | **Expected input type** | <span style="color: #000000">**Expected input value**</span> | <span style="color: #000000">**Examples**</span> |
| --- | --- | --- | --- |
| Date Picker | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Timestamp](http://groovy%20expression%20that%20returns/) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. String representing a timestamp in the [format](http://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html) specified in [Jira system settings](https://confluence.atlassian.com/adminjiraserver073/configuring-the-look-and-feel-of-your-jira-applications-861253125.html#ConfiguringthelookandfeelofyourJIRAapplications-Howtochangedateandtimeformats)*.*
2. [Timestamp](http://groovy%20expression%20that%20returns/) object | 1. `"11/Apr/18"`
2. [Set a date picker field of a Bug to the Fix Version/s release date](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462095239/Groovy+examples#Groovyexamples-SetadatepickerfieldofaBugtotheFixVersion/sreleasedate)
  To manipulate the date see [here](http://docs.groovy-lang.org/latest/html/groovy-jdk/java/util/Date.html) |
| Date Time Picker | [Timestamp](http://groovy%20expression%20that%20returns/) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. String representing a timestamp in the [format](http://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html) specified in [Jira system settings](https://confluence.atlassian.com/adminjiraserver073/configuring-the-look-and-feel-of-your-jira-applications-861253125.html#ConfiguringthelookandfeelofyourJIRAapplications-Howtochangedateandtimeformats)*.*
2. [Timestamp](http://groovy%20expression%20that%20returns/) object | 1. `"11/Apr/18 2:00 PM"`
2. `issue.get("created") + 10`<br>To manipulate the date see [here](http://docs.groovy-lang.org/latest/html/groovy-jdk/java/util/Date.html) |

## <span style="color: #000000">Watcher Field type</span>

| <span style="color: #000000">** Field Name**</span> | **Expected input type** | <span style="color: #000000">**Expected input value**</span> | <span style="color: #000000">**Examples**</span> |
| --- | --- | --- | --- |
| <span style="color: #000000">Watcher field type</span> | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)`[]`<br>[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/78055731)<br>[Collection](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html)`<`[ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/78055731)`>` | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. String representing the *username* of a user
2. String with comma separated values that represent the *usernames* of the users
3. An array of strings that represent the *usernames* of the users
4. Single ApplicationUser object
5. Collection of ApplicationUser objects | 1. `"carter"`
2. `"djohn,carter"`
3. `["djohn","carter"]`
4. `[issue.get("assignee")]`
5. `issue.get("Watchers")` |

## Others

| <span style="color: #000000">**Custom field type**</span> | **Expected input type** | <span style="color: #000000">**Expected input value**</span> | <span style="color: #000000">**Examples**</span> |
| --- | --- | --- | --- |
| Project Picker (single project) | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Project](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461963993) | <span style="color: #000000">A Groovy expression that returns a:</span><br>1. <span style="color: #000000">String representing the project </span>*<span style="color: #000000">id </span>*<span style="color: #000000">or</span>*<span style="color: #000000"> name </span>*<span style="color: #000000">or</span>*<span style="color: #000000"> key</span>*
2. Project object | 1. `"10000"`
2. `"TEST"` |
| Labels | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Set](http://docs.oracle.com/javase/7/docs/api/java/util/Set.html)`<`[Label](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462160018)`>` | <span style="color: #000000">A Groovy expression that returns a: </span><br>1. String representing a value
2. String with space separated values
3. An array of strings that represent values
4. Set of labels | 1. `"New"`
2. `"KB How-to-do"`
3. `["KB","How-to-do"]`
4. `issue.get("Labels")` |
| URL Field | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) | <span style="color: #000000">A Groovy expression that returns a </span><span style="color: #000000">String </span><span style="color: #000000">representing a URL.</span> | "[https://innovalog.com](https://innovalog.com/)" |
| Number Field | [String](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html)<br>[Double](http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html) | A Groovy expression that returns a:<br>1. String containing a number
2. Number in [Double](http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html) format. | - `"33"`
- `"100.5"`
- 20d |