I'm attempting to calculate a RICE score using Automation for JIRA.
I've defined custom fields for Reach, Impact, Confidence, Effort and Score and have those associated with any issue. Each of those fields are in effect choice fields. The confidence field has choices of None, Unknown, High, Medium and Low .. so I can't use the fields value directly .. I need to be able to map them to numeric fields .. which I can then use to calculate a Score eventually.
Obviously what I tried first didn't work, since I tried to use a combo of MAX, IF and {{smart }} values .. and kept on getting errors related to the IF statement getting 4 values when it only supports 3.
So I simplified it to just try a single statement like ..
{{#=}}IF(({{issue.[RICE] Reach.value}}=Everyone),10,1){{/}}
inside a "Then: Edit issue fields" action triggered manually (for testing purposes)

Which then gives me another strange error ..
"Error rendering smart-values when executing this rule:Unknown operator or function: Everyone: IF((Everyone=Everyone),10,1)"
Ultimately, what I'm trying to achieve is to put the following calculation into the "Then: Edit issue fields" action ..
{{#=}}
(MAX(
IF(({{issue.[RICE] Reach.value}}=Everyone),10,1),
IF(({{issue.[RICE] Reach.value}}=Significant),7,1),
IF(({{issue.[RICE] Reach.value}}=Considerable),5,1),
IF(({{issue.[RICE] Reach.value}}=Moderate),10,3),1
) *
MAX(
IF(({{issue.[RICE] Impact.value}}=Massive),10,1),
IF(({{issue.[RICE] Impact.value}}=High),7,1),
IF(({{issue.[RICE] Impact.value}}=Medium),5,1),
IF(({{issue.[RICE] Impact.value}}=Low),10,3),1
) *
MAX(
IF(({{issue.[RICE] Confidence.value}}=High),7,1),
IF(({{issue.[RICE] Confidence.value}}=Medium),5,1),1
)) /
MAX(
IF(({{issue.[RICE] Effort.value}}=3XL),52,1),
IF(({{issue.[RICE] Effort.value}}=2XL),26,1),
IF(({{issue.[RICE] Effort.value}}=XL),13,1),
IF(({{issue.[RICE] Effort.value}}=L),4,1),
IF(({{issue.[RICE] Effort.value}}=M),2,1),1
) {{/}}
But as I said .. it doesn't work .. but it's probably because of how I'm trying to use the IF statement I guess ?.
So, my real question is whether I'm trying something doomed to fail because it's a tad too ambitious .. or am I just not getting the syntax right .. and the above should be able to be gotten to work ?
Thoughts anyone ?. Would really appreciate any insights 