Setting field values

The Set field values action sets the value for a specified field. For all actions, you have to select an "Issue Field", a "Set value mode" (append or overwrite), and a "Content". Once the content is selected, further content-specific configuration can be done.

The supported Jira system fields

The supported custom fields

In case of Single select and Radio button fields the selection is based on the value (coming either from the email with regexp or provided as manual value) in a case-insensitive way.

The currently supported sources are the following:

Fields on the "Set field" form

Issue Field

Select the field that needs to be set.

Set value mode

Choose the handling of the original value of the field. There are two selectable types here:

  • Append to existing value -> Extends the current value of the field

  • Overwrite current value -> Current value will be deleted, new value to be set

Content

Select the source of the field value.

Participants' email addresses

Only visible in case of user-, or text-based field types. Select which participants should be added as value.

Participants' name

Only visible in case of user-, or text-based field types. Select which participants should be added as value. If the participants don't have a name, their email addresses will be used instead.

Extract from email

This option allows the user to extract the field's value from the email.

  • Email part: The source email part:

    • Body

    • Subject

    • Header

  • Regexp: Add a regular expression to find the desired source text in the email.

  • Group: The "old style" method to select the regular expression's result. Add a number, which represents the group of the regular expression's result. If you would like to test the regexp, you may find several testing tools on the internet upon the search term "java regular expression tester".

  • Value Expression: The "new style" method to select the regular expression's result. For more details, please check the "Value expressions" section.

  • Default value: If the regexp result is invalid or empty, then this value will be added.

Manual value

A constant value may be added for the selected field.

  • Value: The constant value that needs to be set. It is also possible to empty a field upon updating an issue. Leaving the Value field empty in an Update issue - Set field action will result in deleting the field's original content.

Value expression

This expression helps the user to add values dynamically to the field. This is a velocity-supported field, so velocity logic can be added here. Email This Issue supports groups of regular expression like in the "old style" Group field. $matchedText is a part of the input text, on which the regex matches. $!group0 represents the whole input text. $!group<n> is the n. group of the regular expression ($!group1 -> first, $!group2 -> second, etc...)

Use case

The admin wants to set the priority by the email's priority. In this example, the priority is stored in the "X-Priority" header as a simple number. "1" represents the Highest, and "5" represents the Lowest priority level.

The velocity code looks like this:

#if($!group0 == "1")
    Highest
#elseif($!group0 == "2")
    High
#elseif($!group0 == "3")
    Medium
#elseif($!group0 == "4")
    Low
#elseif($!group0 == "5")
    Lowest
#end

The form should be filled out the following way:

Issue field: Priority
Set value mode: Overwrite current value
Content: Extract from email
Email part: Header
Header name: X-Priority
Regexp: .*
Value Expression: #if($!group0 == "1")Highest#elseif($!group0 == "2")High#elseif($!group0 == "3")Medium#elseif($!group0 == "4")Low#elseif($!group0 == "5")Lowest

Important:

The above example won't apply to every email client, as all email clients handle priority differently. Please always check your incoming email's headers to find out the best solution for your needs.

Parsers

Parser for cascade fields

$parser.cascade(<VALUE1>, <VALUE2>)

This parser helps the user to handle cascade custom field values. Here is an example of how to use it:

Use case

Have a cascade field that can take parentValue, childValue as parent and child values.

  • Input: MyCascadeValue: parentValue, childValue

  • Regexp: MyCascadeValue:\s*(.*),\s*(.*)

  • Value expression: $parser.cascade($!group1, $!group2)

The cascade field will be set to parentValue, childValue.

Parser for date/time fields

$parser.parseDate(<DATE_TIME_FORMAT>, <VALUE>)

This parser helps the user to handle date-type fields. <DATE_TIME_FORMAT> -> Here you need to add the format of the input date-time. <VALUE> -> The source of the date-time

Use cases

The "Regexp" field's value is Value:\s*(.*) in all cases

  1. A single date in the email:

    • Input: Value: 24/12/2023

    • Parser: $parser.parseDate("dd/MM/yyyy", $!group1)

  2. Date and time in the email:

    • Input: Value: 24/12/2023 11:30

    • Parser: $parser.parseDate("dd/MM/yyyy HH:mm", $!group1)

  3. A date and a time and timezone in the email:

    • Input: Value: 24/12/2023 11:30:00+0000

    • Parser: $parser.parseDate("dd/MM/yyyy HH:mm:ssZ", $!group1)

Zoned DateTime handling

Email This Issue supports Zoned Date-Time for field setting. There are two ways to add the date-time:

  1. The input does not have zone data (ex.: 2025-02-02 10:30:00): In this case, the app uses the sender user's timezone to add the date/time to the field.

  2. The input has zone data (ex.: 2025-02-02 10:30:00+0000): In this case, the app uses the given zone to set the field's value.

This is required because these date-time fields are prepared for international usage (have time-zone property).

To make sure the exact desired time will be saved to the field, it is necessary to add zone-offset data to the time (see example 2 above).

Important: If you are using Set field values with Create issue and you are creating a request, you have to add the field to the Request Type and make it visible on the portal. Remember that you cannot add an Assignee to the portal, and cannot set it during request creation. As a workaround, create the request, set the fields, and in the next action, update the Assignee field.

Note: If you want to add the sender as a request participant to the request, use the Add sender to Request Participants action.

Last updated