I'm trying to do a point spread auto calculation for a selection list with smart values.
List values are field multi-select items which users select when they create/edit their tickets.
Example:
Solution Change Type:
- Software
- Network
- Content
- Content in Software
- etc.
Can't get the syntax right. What I want is my value if the item is selected and a zero if it is not selected.
Trigger: When value changes for "Solution change type" change
Action: Edit issue fields > Story Points
Example of desired calculation.
{{#math}}
IF(exists({{issue.Solution Change Type.get(0).value}}),2,0) +
IF(exists({{issue.Solution Change Type.get(1).value}}),1,0) +
IF(exists({{issue.Solution Change Type.get(2).value}}),1,0) +
IF(exists({{issue.Solution Change Type.get(3).value}}),1,0)
{{/}}
I've tried a number of variations but I either end up with ' + + + + +' or
Error rendering smart-values when executing this rule:
Unknown function 'Software' at position 15: IF(exists(Software (new or changes)),1,0) + IF(exists(Content Changes (in software code)),1,0) + IF(exists(),1,0) + IF(exists(),1,0) + IF(exists(),1,0) + IF(exists(),1,0) + IF(exists(),1,0) + IF(exists(),1,0) + IF(exists(),1,0) + IF(exists(),1,0) + IF(exists(),1,0)
My two issues are:
1. Getting the IF to work so I get one value on success and the zero otherwise.
2. The positional arguments are not fixed, even though the list field is. If only the last item is selected it is returned for the get(0) instead of its field position of get(10).