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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,980
Community Members
 
Community Events
185
Community Groups

Automatically set a multi-choice field value based on text

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?

Screenshot 2023-05-12 at 16.51.02.png

 

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"
}
}
}

1 answer

1 accepted

2 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.
May 12, 2023

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:
Screenshot 2023-05-13 at 8.33.27.png

And here is what the Audit log says

Screenshot 2023-05-13 at 8.36.58.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.
May 14, 2023

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.

Like Gergana_Damyanova likes this

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.

Like Trudy Claspill likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events