I am a beginner in groovy, I am trying to write a script that detects the type of the event that triggers it, I have two:
- A channel trigger
- An item state change
I want my script to create a string variable to be used later in each case.
I make this test script to just print out the string i create in the if statement but i get an error that this variable does not exist.
did I do something wrong in declaring the variable? is there a scope issue?
NOTE: if I move the logger.info(str) inside the conditional expression, everything works fine!