Forums

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

Conditional statement in ConfiForms IFTTT macro body getting invalid format error

Brian Karst
Contributor
June 9, 2020

I am trying to not send a select list (cascading) custom field when the user doesn't select any of the options. Using the instructions in https://wiki.vertuna.com/display/CONFIFORMS/Conditional+statements+in+IFTTT+macro+body

I have placed a conditional statement in my body however it is throwing the error.

Could not prepare JSON: '{ "fields": { "project": {"key": "PSNSPLAY"}, "issuetype": {"name": "Improvement"}, "summary": "Sending with no Department & Division selected CONDITIONS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", "customfield_13062": {"id":}, }, }'. Invalid format. Missing value at 242 [character 33 line 6] Used JSON: '{ "fields": { "project": {"key": "PSNSPLAY"}, "issuetype": {"name": "Improvement"}, "summary": "Sending with no Department & Division selected CONDITIONS!", "customfield_13062": {"id":}, }, }'

 

This is what is in the macro body. It seems so simple so what am I missing here?

{
"fields": {
"project": {"key": "PSNSPLAY"},
"issuetype": {"name": "Improvement"},
"summary": "Sending with no Department & Division selected using CONDITIONS!",
#set ($dep = "[entry.smartdepart]")
#if ($dep)
"customfield_13062": {"id":[entry.smartdepart.ID]},
#end
},
}

 

1 answer

0 votes
Alex Medved _ConfiForms_
Community Champion
June 9, 2020

Your IF statement 

#set ($dep = "[entry.smartdepart]")
#if ($dep)
"customfield_13062": {"id":[entry.smartdepart.ID]},
#end

is always true. As you check if there is a $dep variable

Take a look at Velocity documentation https://cwiki.apache.org/confluence/display/VELOCITY/CheckingForNull on this

Alex

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