Morning community,
I'm trying to create a Jira automation rule to do the following.
I have two custom fields, both drop-down lists:
- Custom Field 1: Client Name(s)
- Custom Field 2: Name
I aim to automatically fill out Custom field 2 with the Custom field 1 first value.
Example:
if Custom field 1 = Jira, Confluence, Cloud, then Custom field 2 would show only Jira
I created the following JSON, but it's somehow not working.
{
"update": {
"Custom Field 2": [{
"set": { "value": "{{Custom field 1}}" }
}]
}
}
Can you please help me out?
Please, don't use JSON for such tasks. It can be made with standard functions of smart values.
Your customfield_2 - is standard field with "multiple select from list" type.
In Jira automation you can pull first or last value from list of values in field. Use list.first function. Here you can find examples:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or would it be something like this?
{
"fields": {
"Custom field 2": "{{#issue.fields.customfield_1}}{{customfield_1.first}}{{/}}"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Antonio Carvetta you have to add action Edit Issue, select required field, and use there string like:
{{issue.customfield_22222.first.value}}
(change 22222 to your customfield id)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's strange. What types of fields are you using? Type of field, from which you try to copy first value, and type of field, where you try to paste it?
I repeated case on my stand, everything works fine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let me try to provide further details.
Both fields are 'Select List (multiple choices)
The first custom field contains 100 values, while the second one contains just 20.
I am aiming to perform the following.
If custom field 1 is filled out with 1 specific value - which I imported in custom field 2, reflect the value into the custom field 2.
If custom field 1 is filled out with 2+ values, and the first one is also present in the custom field 2 dropdown list, automatically reflect it into the custom field 2. dropdown list
Does it make sense, or do you want me to draw something up?
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What problem are you trying to solve by doing this? And specifically, what is significant about the "first" value, and what does "first" mean to you? Simply put, why do this?
Knowing these things will help the community to offer suggestions relevant to the problem you are trying to solve.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You do not describe "why" (i.e., the problem you are trying to solve). Regardless...
The suggestion already offered should work, if the different field values are aligned. The reason is that the id values could be different with two different custom fields, and so values must be used.
Let's try this: please write the following to the audit log immediately after the rule trigger and then post images of you updated rule showing that write and the audit log details showing the rule execution.
{{issue.your custom field name.first.value}}
If that shows nothing, it is likely you have the incorrect smart value for your field. To find the correct smart value (or custom field id) for your field, please use this how-to article. Essentially, you identify an example issue with your field, call the REST API with a browser, and then search for your field.
Smart values are name, spacing, and case-sensitive, so this will confirm you have the correct one. If you do not see your field, it is likely not supported by automation rules.
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Bill Sheboy and @Evgenii . Everything works as expected.
I basically wasn't aware of using the custom field key. It works now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.