Forums

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

"Did you forgot to wrap the expression in double curly braces" error in JMWE post-function?

Antoine [Klee Group]
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.
October 20, 2021

Hi,

I have this error popping up on a very simple conditional block in a condition for the post-function Set issue fields post-function.

Here is the conditionnal block

{% if issue.fields.customfield_10287.value in ["value1", "value2"] %}
true
{% endif %}

When I test this tiny script against an issue it works perfectly. But I cannot save the post-function, the error "Did you forgot to wrap the expression in double curly braces" occurs.

Capture d’écran 2021-10-20 181533.png

The customfield is a Select List (single choice) and issue.fields.customfield_10287.value returns a string.

I have tried including braces as such {{ issue.fields.customfield_10287.value }} but then the script just does not work at all.

 

Did any of you already faced this "syntax" issue?

Thanks.

1 answer

1 accepted

0 votes
Answer accepted
David Fischer
Community Champion
October 20, 2021

Hi @Antoine [Klee Group] 

that looks like a bug...

But in your case, there's a simple workaround:

{{issue.fields.customfield_10287.value in ["value1", "value2"]}}

which already returns true or false (you don't need the if block at all) 

Antoine [Klee Group]
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.
October 21, 2021

Indeed, thanks a lot David.

Suggest an answer

Log in or Sign up to answer