Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I'm doing an automation that should set a the value of a custom field based on some text that is dynamically extracted.
I can't get my head around how to update the value of the field.
The key of the project is extracted correctly and is present in the multi-choice options, but I don't know how to select the option that matches the text from the smart value.
Any ideas?
This is how I do the update:
{
"fields": {
"customfield_10453": {
"value": "{{issueProject}}"
}
}
}
The above doesn't work, however with a hardcoded value it works
{
"fields": {
"customfield_10453": {
"value": "MC"
}
}
}
Hello @Gergana_Damyanova
Is the custom field one where you can select only one value or were you can select multiple values?
Have you confirmed that the smart value {{issueProject}} actual contains MC by using the Log action to print the smart value in the rule Audit Log?
Hey @Trudy Claspill ,
Only one value can be selected for the custom field.
The issueProject value is ok, and passes the right value that is one of the options in the multi-choice. You helped me with this just the other day: {{issue.key.substringBefore("-")}}
So using this, I'm able to extract the value I want, but for some reason the multi-choice field doesn't like it.
Here is a proof I have it in the multi-select:
And here is what the Audit log says
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please use a Log action to print the value of your variable in the Audit Log.
If TK111111-6 is the issue that is triggering the rule, and
If you are setting the variable to {{issue.key.substringBefore("-")}}, then
The variable is getting set to TK111111, and
TK111111 is not a valid value in the selection list for which you provided an image.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh man, such a silly mistake, this is embarrassing.
I've put the issue number, not just the project key, thanks for pointing this out @Trudy Claspill , somehow I overlooked it.
Thanks again, I changed the option in the multi-choice and its working.
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.