Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Say I have a checkbox field or multi select field (e.g. called 'Equipment') and I want to show a list of all selected values in a comment that's being added, what's the correct Smart Fields syntax for this?

This does not work:

No Format
{{issue.fields.Equipment}}

I would like this to print: Computer, Monitor, Mouse 

Step-by-step guide

To print out multi-value fields you need to use the mustache list iteration syntax.  The exact expression depends a bit on the type of field.  Here's some examples:

...

No Format
{{#issue.fields.Equipment}} {{value}}{{/}}

...

Computer Monitor Mouse

...

No Format
{{#issue.fields.Equipment}} {{value}}{{^last}},{{/}}{{/}}

...

Computer, Monitor, Mouse

...

No Format
{{#issue.fields.QA Tester}} {{displayName}}{{/}} 

...

Barney Rubble Fred Flintstone

...

No Format
{{#issue.fields.labels}} {{.}}{{/}}

...

label1 label2 label3

...

Filter by label (Content by label)
showLabelsfalse
max5
spacesAUTO4J
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "kb-how-to-article" and type = "page" and space = "AUTO4J"
labelskb-how-to-article

CBS-1877
Page Properties
hiddentrue
Related issues
Jira Legacy
serverIdddbbe3dc-b4d3-3215-bd7e-6a0d3451590b
key
Info

Our documentation has recently move to a new location! Please head on over to: https://docs.codebarrel.io/automation/smart-fields/working-with-lists.html