Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to reference each value of Multi-select custom field with smart values?

N Y
Contributor
November 9, 2022

Hello,

I have a multi-select custom field built into one of my issue types, with 6 possible options.
When I access the field by {{issue.customfield_10062.value}} and output the value to the Audit Log,  Jira returns all activated options of the multi-select field separated by a comma.
Is it possible to reference each value of the multi-select custom field by its own?

I tried

{{issue.customfield_10062.value[1]}} and

{{issue.customfield_10062.value.1}} and 

{{issue.customfield_10062.1.value}}

with no sucess.

2 answers

1 accepted

1 vote
Answer accepted
Mark Segall
Community Champion
November 9, 2022

Hi @N Y 

You'd need to do something like this:

{{issue.customfield_10062.value.get(n)}}

This will return the selected values.  For example, I have

Option1
Option2
Option3
Option4
Option5

User selects 1 and 3

{{issue.customfield_10062.value.get(0)}} will return Option1

{{issue.customfield_10062.value.get(1)}} will return Option3

 

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.
November 9, 2022

Hi @N Y 

Adding to Mark's answer...

With the smart values in the rule, you may access the values which are selected only; not all possible values.  Which of these did you mean?

Kind regards,
Bill

N Y
Contributor
November 10, 2022

@Mark Segallthnx, it worked!
Anyways, is there a documentation available that lists functionalitites like this somewhere?
@Bill Sheboyyes, i wish to access the selected values only.

Like # people like this
Mark Segall
Community Champion
November 10, 2022
Like # people like this
N Y
Contributor
November 10, 2022

Thank you so much!

Like Mark Segall likes 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.
November 10, 2022

Yes, and...one key source on that documentation page is this one:

https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

This how-to article describes finding if a field is supported as a smart value, and what the correct smart value is.  Smart values are name, spacing, and case-sensitive...so often rule problems come from using the wrong name (which leads to a null value, and no error messages).

Like N Y likes this
N Y
Contributor
November 10, 2022

You guys are awesome! Thanks once again

Like # people like this
Elzha Odie February 27, 2023

hi peeps, i want to adopt this solution when i'm integrating jira and opsgenie. when i set the opsgenie property like this below, then i couldn't see the value of selected list. is there any hint for me?

{{issue.customfield_10062.value.get(n)}} 

 Screenshot_1.png

0 votes
Jesus Octavio Gutierrez Villegas
Contributor
March 19, 2024

Hello @Bill Sheboy / @Mark Segall 

First of all, thanks for your time and great work on answering our questions.

I have a quick issue... I wish to obtain the selected values of a "checkbox" field type...


Is it possible?

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.
March 19, 2024

Hi @Jesus Octavio Gutierrez Villegas 

First thing: this is a very old thread, and so I recommend creating a new question rather than adding new ones onto it.  That will help more people see it to offer suggestions.  Thanks!

Regarding checkbox fields, that depends upon what you mean by "checkbox field":

  • If it is the built-in type, the value attribute may be used the same as an option field
  • If it is a field from a marketplace addon, please check the vendor's documentation to learn how to access the values

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events