Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation to update Custom Field (Select List, Single Choice) with an existing value

Ivan Garcia February 17, 2025

Hoping to get some help creating some automation that might help my team work a little better, and with less tedium.

I'm curious to learn if there is a way I can create automation that will populate a custom field (Select List type, single choice) with the value that appears in the another. To provide more information for a follow-up example. The custom field would be named Organization Name. This custom field contains Options I can use as a single select dropdown list of options, some of these options would be:

  • Value 1
  • Value 2
  • Value 3

An example use-case would be the following:

  1. I create a Task wherein Summary = Value 2
  2. Automation would be: When a Task is created, update Organization Name field value to pull from Summary
  3. Wherein the result would be that Organization Name = Value 2

I'm curious is this would be possible. I don't know if the custom field being a list of values creates problems vs just a label. And I likely understand that the value in Summary would need to be exactly the same as the option in the custom field.

Any help would be appreciated!

 

2 answers

1 accepted

3 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 17, 2025

Hello @Ivan Garcia 

Yes, that is possible used Advance Editing with JSON.

In the Edit action you would expand the More Options section and use the code shown below:

{
"fields": {
"Organization Name": {
"value": "{{issue.Summary}}"
}
}
}

Screenshot 2025-02-17 at 1.39.58 PM.png

Here is a link to more detailed information about Advanced Editing with JSON.

https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json

Ivan Garcia February 17, 2025

I appreciate the input, though after trying, I receive the following error when attempting to enable the rule.

Curious if this has to do with the custom field as it's a single choice, list; rather than a freeform field, like a label would be.
Capture.PNG

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 17, 2025

No, the type of field is not the problem. I tested what I provided to you with a Select List (single choice) field.

I notice that the code you have shown says Client Name for the field while the error message says Organization Name.

I suggest that you delete the Edit action entirely, add a new Edit action, add the corrected code, and then try to save the rule again.

Additionally, does the field appear in the Edit/View screen/s for the specified type of issue you are trying to edit with the Automation Rule?

Ivan Garcia February 18, 2025

Thank you for the follow-up, Trudy. I tried the updating the code entirely as well as confirmed that the field is present in the screens. The only other thing I can think of that may cause an issue is that this is being used in Team-managed project. Not sure if that is a limitation.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 18, 2025

I've tested the same code in a Team Managed project and it works.

Sometimes for inexplicable reasons rules become corrupted from repeated editing. If that has become the case, please try recreating the rule entirely from scratch.

The method @Sirine stated also works. You don't actually need to use JSON.

Screenshot 2025-02-18 at 9.45.22 AM.png

 

If neither method is working please provide screen images showing your entire rule and the details of the Edit issue step. Let us know if the problem is still in trying to save the rule, or if the rule can now be saved and executed but you are not getting the results you expect.

If the rule runs but you don't get the expected results, please also provide screen images of the rule execution audit log with all details shown.

Ivan Garcia February 18, 2025

@Trudy Claspill Thank you for outlining! I was able to successfully update the automation and turn it on. Though the new issue now seems to be that the subtask is not being updated. I've offered some screenshots, very much appreciate the help! I'm using Client Name, this case as a test.

Capture.PNG Capture2.PNG Capture3.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 18, 2025

Hello @Ivan Garcia 

Can you please provide screen images showing your entire rule and the details of the Edit issue step?

Have you confirmed that the content of the Summary field is an exact match for the option in the field? Are there any blank spaces before or after the text in either the Summary field or the option name?

Like • Bill Sheboy likes this
Ivan Garcia February 18, 2025

Capture4.PNG

I confirmed in a few instances, checked for spacing, capitalization, apostrophes etc. But all instances of what is in Summary match a value within the custom field.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 18, 2025

Do the same option values and Summary values work when used in issues that are not subtasks?

There may be a timing or race condition happening because your trying to edit the issue immediately after it is created. Before the Edit Issue action try adding a Re-fetch Issue Data action.

Like • 2 people like this
Ivan Garcia February 19, 2025 edited

Capture5.PNG

I added the re-fetch data action just prior to the edit step and I updated the automation to test with both Tasks and Epics, unfortunately no success as of yet. I also confirmed that the custom field was present in all issue types tested.

 

I'm not sure if this has anything to do with this, but would it matter if it was being used in a Team managed project vs a Company managed? I'm trying to get this automation working in a team-managed project; but not sure if that makes any difference.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2025

Hi @Ivan Garcia 

Please add a write to the audit log in your rule to compare what is in the Summary field to what you are trying to save as an option.  This will confirm it exactly matches (or not) one of the possible values, and that there are no extraneous characters around it.

issue summary contains: >>{{issue.summary}}<<

That Log write action should be after the Re-fetch Issue action.

Then test your rule, and post images of the updated rule and audit log details.  Thanks!

Kind regards,
Bill

Like • 2 people like this
Ivan Garcia February 19, 2025

Thank you for your input @Bill Sheboy I gave this a shot but as of yet, no success, unfortunately. Still no value appearing in the custom fieldCapture8.PNG Capture6.PNG Capture7.PNG

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2025 edited

Thanks for trying that, @Ivan Garcia 

Let's return to Trudy's original suggestion with JSON with a slight change.  This will test the hypotheses that either: the rule is confused by what field to use, and / or there are multiple "Client Name" fields in scope for the issue.

 

First, find an issue which as a value set in your "Client Name" field.  Note the issue key.

Now let's use this how-to article to identify the custom field ID for the field: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

The basic steps are:

  • Open a new browser tab and enter this URL, substituting in your Jira URL and issue key.
https://<yourinstanceurl>/rest/api/3/issue/<yourIssueKey>?expand=names
  • Now search on the page for your field, perhaps using the Control-F find
    • if you find multiple fields with that name, that was likely the problem, and needs to be addressed in the issue type configuration
  • Note the custom field ID value, which will probably look like this:
"customfield_12345": "Client Name",

 

Now returning to your rule, and the Edit Issue action:

  • remove the "Client Name" field from the dropdown selections
  • move down to the More options ... Additional Fields section to enter this JSON, substituting in your custom field ID
{
"fields": {
"customfield_12345": {
"value": "{{issue.summary}}"
}
}
}
  • Select another rule component (such as the Re-fetch Issue) to exit the Edit Issue action.  (This will prevent the rule editor from complaining about not being ready to save the action.)
  • Now update the rule to save it
  • Test again, and let us know what you observe, posting images of the updated Edit Issue action and audit log

 

Like • 2 people like this
Ivan Garcia February 20, 2025

Thank you @Bill Sheboy for this detailed explanation and breakdown. Happy to report a success!

Despite there being only one custom field for Client Name, breaking it down by the custom field ID value must have pointed the automation to the correct place.

Thank you again as well @Trudy Claspill @Sirine for all your input and follow-ups! So happy it ended up working out.

Screenshotted the final rule in case any other users come looking for a similar solution.
Capture9.PNG

Like • 2 people like this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 20, 2025

Awesome; I am glad to learn that helped!

FYI -- Unless you have more steps after what is shown, that last Re-fetch Issue action is not needed.  Removing it will speed up the rule slightly, and reduce the load on your rule usage measures.

0 votes
Sirine February 18, 2025

Hi @Ivan Garcia 

You can : 

  1. Use a Smart Value to map the Summary to your custom field:

    • In the automation rule, set the Organization Name field value to:

      {{issue.Summary}}  
  2. Ensure the Summary value exactly matches one of the dropdown options in Organization Name.

If this still doesn’t work, it might be worth exploring Colored Label Manager.


It simplifies managing and automating custom fields , wich this documentation might be helpfull 

Best regards,
Sirine

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events