Action Script IF substitution

Trying to validate input for a fixlet but the relevance action script substitution isn’t working properly.

action parameter query "ResourceEnv" with description "prod or test?" and with default value "prod"

if { not (exists ("prod";"test") whose ("(parameter ResourceEnv of action)" as string contains it)) }
exit 3
endif

This is hitting the exit when I send “test” or “prod”.

It looks like the problem is having "(parameter ResourceEnv of action)" in quotes. That will just be a literal string in relevance.

Try something like:

action parameter query "ResourceEnv" with description "prod or test?" and with default value "prod"

if { not exists ("prod";"test") whose (parameter "ResourceEnv" of action contains it) }
exit 3
endif
2 Likes

That was it. I had to update it to be exact, but you got me in the right direction. Thanks!

parameter "ResourceEnv" of action equals it
1 Like