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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Smart values for custom field with checkbox selections not working

I have followed the documentation for accessing smart values for list items and have tried all the different variation shown here:

Use Smart Values to Access Listed Values 

I also tried testing by having it write a log and it's not working.

The custom field is "Environment" and my selections are:

Production

UAT

Test

Development

I check the log and it says success and the result is this:

ScreenShotofLog.jpgHere is a snippet of one of the smart value code I used:

ScreenShotofVariableCode.jpg

The flow is this - A user fills out a support request form in the portal choosing the type of "Environment" and submits.  This is then in the body of the ticket of JSM.  I'm trying to access this checkbox value to populate into a Slack channel message.  No matter what I try, the response is empty.

Thanks!

2 answers

1 accepted

Darryl, 

Thanks for your help.  That too didn't work, BUT, I kept trying different variations only to find that for whatever reason "Environment" as an argument was not being acknowledged by the script.  This is what I finally landed on that worked:

{{issue.customfield_10090.value}}

I had to use the json format for custom field and that worked.   

Glad you figured it out. 

I'm a bit confused by your final solution though. What does that last .issue refer to?

In restrospect I should have suggested you try:

{{issue."Environment".value}}

A while back @William Sheboy figured out that for some reason, Automation requires Project Property keys to be double-quoted. Might have been worth a try in this situation too.

Please note: Sometimes the double-quotes are needed and sometimes not...

Smart value expression parsing appears to use the period (.) to de-reference elements, and so when the entity property contains a period it needs to be enclosed in double-quotes.  That probably triggers some escaping logic.

I haven't clearly identified the other cases when the double-quotes are required.

__Bill

It sure would be nice if somebody officially weighed in and, I dunno, maybe documented this? :-}

Let's play tag! @and @Nick Menere [Atlassian] @Nick Menere @Andreas Knecht @John McKiernan 

Did I miss anybody?

You should be able to use {{issue.Environment.value}} without the quotes. Quotes are only required when there are special characters (like another . ) in the name of the field

Like Bill Sheboy likes this

Your suggestion and following Atlassian's exact documentation failed every time.  See my solution below that worked.  I'm assuming that the word Environment is some sort of standard class, attribute or variable within Atlassian's code base so it's probably getting confused on how to execute.  I changed it per rest API documentation to use 'customfield_0000' and that worked.  Code recognized it and executed the automation script flawlessly.

@Darryl Lee sorry... my bad.  Type in the code snippet I put as my answer.  I fixed it.

Maybe try a simpler test first?

{{#issue.Environment.value}}

To validate that the values are showing up at all? That should generate a comma-delimited list.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Service Management

Why upgrade to Jira Service Management Premium?

We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan.  &nb...

196 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you