I have a select list (single choice) called options that has the following selections: 1,2,3,4,5. I want to be able to use this selection list so that I can send specific information in an email depending on what select list is selected via Jira automation email. Right now my email is is setup for
{{#if (issue.options>= 1}}
You have selected option 1.
{{/}}
{{#if (issue.options>= 2}}
You have selected option 2.
{{/}}
Note, The if statement continue all aways up to 5.
However the if statement is not working correctly right now, even though i trigger the automation rule with option 1 selected, I dont get the text back in my email. What am I doing wrong here. Any help would be nice!
Hello @Dominic Mercorelli
Jut curious, Have you logged {{issue.options}} to see if you are seeing the selection?
Or should it be {{issue.options.value}}
Once you know the right smart value, try to apply asNumber to it to convert it to number..
{{issue.options.asNumber}} and see if your if condition evaluates correctly.
Hello @Kalyan Sattaluri
I went ahead and log {{issue.options}} and {{issue.options.asNumber}} and it did not log correctly, it was actually blanket. However when I logged {{issue.options.value}} it logged the correct number. So therefore I went ahead and changed by if statement to below and it did not return the "You have selected option X" in the email. Instead it we just a blanket email. What I am doing wrong with the if statements? That is where I feel like the problem is.
{{#if (issue.options.value>= 1}}
You have selected option 1.
{{/}}
{{#if (issue.options.value>= 2}}
You have selected option 2.
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please use this syntax:
{{#if(issue.options.value.asNumber.gte(1))}} You have selected option 1. {{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also just suggesting, please log first to confirm before sending emails, avoids digital spam. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{{#if(issue.options.value.asNumber.gte(1))}} You have selected option 1. {{/}} worked thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.