Elements Connect

How to set custom field value in Automation rule based on a Jira Text field

Objective

Learn how to set the value of an Elements Connected custom field using a Jira Automation rule, based on the content of a Jira Text field.

This guide covers four scenarios: snapshot single-value fields, snapshot multi-value fields, object fields, and user fields. Useful for Jira admins automating data flows between native Jira fields and Elements Connect custom fields.

Tutorial

Prerequisites

  • Elements Connect is installed on your Jira Cloud instance

  • A Jira Text field (Single line) has been created and added to the relevant project/screen (let’s say the project is PM).

  • The ID of the created Jira Text field has been identified (follow this KB to find your custom field ID). Let’s say the ID is “customfield_yyyyy”

  • A REST API datasource has been configured in Elements Connect, connected to your local Jira instance (this is the cross-project / Jira-to-Jira lookup pattern, see Configure a local Jira instance as a data source for the setup), and successfully tested.

Steps

We need to set the value of a Connected custom field, Issue picker, plugged to local Jira REST API.


Case 1 - Set Snapshot custom field (single value)

Custom field configuration
  • Create a Connect custom field, Single Select List, and select the custom field type as Snapshot:

image-20260624-121851.png
  • Configure your custom field:

  • Elements Connect Snapshot single value custom field configuration in the administration panel
Custom field filter configuration
  • Set the template as below (the field will display and store the issue key):

Elements Connect custom field template configuration showing the issue key as displayed value
  • Save your field configuration

  • Add the field to a project/screen (let’s say the project is PM)

  • From the Elements Connect administration page, note the Connect custom field ID (let’s say it's customfield_xxxxx)

    Nouveaux visuels documentation Connect (1496 x 400 px) (1).png
Automation rule configuration
  • In Automation for Jira, create a rule as below:

    • Trigger: Manually triggered (or any trigger of your choice).

    • Action: Edit work item fields

      • Select “More options” and in “Additional fields” section, paste the below

        {
           "fields":{
              "customfield_xxxxx":"{{issue.fields.customfield_yyyyy}}"
           }
        }
        
      • Replace customfield_xxxxx by the ID of your Connect field, customfield_yyyyy by the ID of your Jira Text field:

        Jira Automation rule 'Edit work item fields' action with JSON payload to set an Elements Connect Snapshot custom field
    • Set rule name and publish it.

  • Trigger the rule manually from the project where you’ve added the Jira text field and the Connect field (let’s say the project is PM) and the value of the Text field will be copied into the Connect field.

It’s mandatory that the value in the Jira Text field matches the value defined in the field Template.


Case 2 - Set Snapshot custom field (multi values)

Custom field configuration
  • Create a Connect custom field, Multi List, and select the custom field type as Snapshot:

image-20260624-121851.png
  • Configure your custom field:

Elements Connect
Custom field filter configuration
  • Set the template as below (the field will display and store the issue key):

image-20260624-132628.png
  • Save your field configuration

  • Add the field to a project/screen (let’s say the project is PM)

  • From the Elements Connect administration page, note the Connect custom field ID (let’s say it's customfield_xxxxx)

Elements Connect administration page showing the custom field ID (customfield_xxxxx) used in Jira Automation rules
Automation rule configuration
  • In Automation for Jira, create a rule as below:

    • Trigger: Manually triggered (or any trigger of your choice).

    • Action: Edit work item fields

      • Select “More options” and in “Additional fields” section, paste the below

        {
           "fields":{
              "customfield_xxxxx":[{{#issue.fields.customfield_yyyyy.split(",")}}"{{.}}"{{^last}}, {{/}}{{/}}]
           }
        }
        
      • Replace customfield_xxxxx by the ID of your Connect field, customfield_yyyyy by the ID of your Jira Text field:

        image-20250521-094649.png
    • Set rule name and publish it.

  • Trigger the rule manually from the project where you’ve added the Jira text field and the Connect field (let’s say the project is PM) and the values of the Text field will be copied into the Connect field, as show below:

    Jira issue showing the Elements Connect custom field value populated by the Automation rule

It’s mandatory that the value in the Jira Text field matches the value defined in the field Template.

Furthermore, the values must be separated by a comma. If a different delimiter is used, the Automation rule must be adjusted accordingly.


Case 3 - Set Single Select list Object custom field

Custom field configuration
  • Create a Connect custom field, Select list single value, and choose the field type Object:

image-20260624-132912.png
  • Configure your custom field:

image-20260624-133140.png
image-20260624-133232.png


  • Enable the option Live update in the Query section

  • In the Live path, use the below (where customfield_xxxxx is the ID of the current Connect custom field)

Nouveaux visuels documentation Connect (1840 x 900 px) (11).png
  • In the Template section (this means that for this object, we will store the issue id in its ID attribute, and issue key will be stored in the template attribute)

    2024-12-24 14_00_59-Elements Connect - Configuration - Jira.png


  • Save your field configuration

  • Add the field to a project/screen (let’s say the project is PM)

Automation rule configuration
  • In Automation for Jira, create a rule as below:

    • Trigger: Manually triggered (or any trigger of your choice).

    • Action: Edit work item fields

      • Select “More options” and in “Additional fields” section, paste the below

        {
           "fields":{
              "customfield_xxxxx":{
                 "id":"{{issue.fields.customfield_yyyyy}}",
                 "value":""
              }
           }
        }
        

        info Even if the value attribute is empty, it remains mandatory.

      • Replace customfield_xxxxx by the ID of your Connect field, customfield_yyyyy by the ID of your Jira Text field:

        image-20250430-072934.png
    • Set rule name and publish it.

  • Trigger the rule manually from the project where you’ve added the Jira text field and the Connect field (let’s say the project is PM) and the value of the Text field will be copied into the Connect field

It’s mandatory that the field is Live (the option “Recalculate displayed value on issue view” is checked) and that value in the Jira Text field matches the value defined in the Object ID attribute


Case 4 - Set User custom field

Custom field configuration
  • Create a Connect custom field, User - Select list (single choice):

image-20260624-134646.png
image-20260624-134709.png
  • In the “Display” section, set the ID you want, either ${row.accountId} or ${row.emailAddress}. Please note that this will not affect the automation rule below, which can only populate a user field using the accountId attribute:

image-20260624-134736.png

2 methods are available, depending on whether you want to use an email address or an account ID:

A. Using an Account ID

Automation rule configuration
  • In Automation for Jira, create a rule as below:

    • Trigger: Manually triggered (or any trigger of your choice).

    • Action: Edit work item fields

      • Select “More options” and in “Additional fields” section, paste the below

        {
           "fields":{
              "customfield_XXXXX":{
                 "accountId":"{{issue.fields.customfield_yyyyyy}}"
              }
           }
        }
        
      • Replace customfield_XXXXX by the ID of your Connect field, customfield_yyyyy by the ID of your Jira Text field:

        image-20250430-073026.png
    • Set rule name and publish it.

  • Trigger the rule manually from the project where you’ve added the Jira text field and the Connect field (let’s say the project is PM) and the value of the Text field will be copied into the Connect field

To populate a user field, customfield_yyyyyyy must contain a valid user account ID.

B. Using an email address

The principle is the same as with the first method, and we will use the account ID to populate the User field, but with an additional step to retrieve the account ID from the user's email address.

Automation rule import

For your convenience, you can import the following automation rule directly into your Jira instance: automation-rule-set-connect-user-field-using-email-address.json

Once imported, you will need to update it based on your specific configuration:

  1. Edit the Send Web Request action:

    • In the Web Request URL, replace customfield_yyyyy with the ID of your Jira Text field.

    • In the Authorization header, replace ENCODED_BASE_64_TOKEN with the token you generated by following the procedure described here: How to encode a Token to Base 64?

  2. Edit the Edit work item fields action:

    • Replace customfield_XXXXX with the ID of your Connect field.

Automation rule configuration
  • In Automation for Jira, create a rule as below:

    • Trigger: Manually triggered (or any trigger of your choice).

    • 1st Action: Send Web Request

      • Web request URL:

        https://YOUR_JIRA_BASE_URL.atlassian.net/rest/api/3/user/search?query={{issue.customfield_YYYYY}}
        

        info Replace YOUR_JIRA_BASE_URL according to your own Jira instance, and customfield_yyyyy by the ID of your Jira Text field

      • HTTP method: GET

      • Web request body: EMPTY

      • Activate the option “Delay execution of subsequent rule actions until we've received a response for this web request“

      • Headers:

        Authorization: ENCODED_BASE_64_TOKEN
        Content-Type: application/json
        

        info Generate ENCODED_BASE_64_TOKEN by following the procedure described here: How to encode a Token to Base 64?

    • 2nd Action: Edit work item fields

      • Select “More options” and in “Additional fields” section, paste the below

        {
           "fields":{
              "customfield_XXXXX":{
                 "accountId":"{{webResponse.body.accountId}}"
              }
           }
        }
        
      • Replace customfield_XXXXX by the ID of your Connect field:

        image-20250430-073200.png


Frequently asked questions

Can I set an Elements Connect custom field value with Jira Automation?
Yes. Use the "Edit work item fields" action in Jira Automation, and provide a JSON payload that matches the Elements Connect field type (snapshot, object, or user).

What's the JSON syntax for a Snapshot single-value field?
{ "fields": { "customfield_xxxxx": "{{issue.fields.customfield_yyyyy}}" } }

What's the JSON syntax for an Elements Connect Object field?
{ "fields": { "customfield_xxxxx": { "id": "{{issue.fields.customfield_yyyyy}}", "value": "" } } }. The value attribute can be empty but must be present.

Does the Edit work item fields action support Elements Connect User fields?
Yes. Populate using accountId only, not email. To use email as input, add a Send Web Request action that calls the Jira user search API first.

My Object field automation isn't updating the displayed value. Why?
Make sure the "Recalculate displayed value on issue view" option is checked in the custom field configuration. Without it, the Object field stores the ID but doesn't refresh the displayed Template value.