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:
An example use-case would be the following:
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!
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}}"
}
}
}
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
https://<yourinstanceurl>/rest/api/3/issue/<yourIssueKey>?expand=names
"customfield_12345": "Client Name",
Now returning to your rule, and the Edit Issue action:
{
"fields": {
"customfield_12345": {
"value": "{{issue.summary}}"
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ivan Garcia
You can :
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}}
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.