I want to create an automation that shows how many filtered cases I had last week. Everything works fine if I have at least one case. What should I do to ensure that the automation and Smart Values accept a value of zero?
Hi @Kari Laine you could use an advanced compare condition in your rule
{{lookupIssues.size|0}} is greater than or equal to 1
Thank you, here is more information:
PrioOneSum = A special field that sums the values of all filtered cases → result in X minutes.
PrioOneAll = The total number of filtered cases → in other words, how many cases there are.
This formula works if I have at least one case:
{{#=}}{{prioOneSum}} / {{prioOneAll}}{{/}}
However, there could be weeks when there are no filtered cases, and both values could be zero or empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you explain "filtered cases", how is this expressed? Why not just have a condition before the component that has the formula to check if {{prioOneAll}} is not zero?
Maybe if you shared screenshots of your actual role, I can assist further.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
More information:
1. First I have filter, what must be True ( correct Customer + last week + correct priority etc.)
"* VALUE[dropdown]" = " VALUE1 " AND Organizations = " VALUE2 "
AND "VALUE3[Dropdown]" = "VALUE4"
AND "* VALUE5[Time stamp]" >= startOfWeek(-7d)
AND "* VALUE5[Time stamp]" < startOfWeek()
AND "* VALUE5[Time stamp]" IS NOT EMPTY
AUTOMATION
Lookup issues // filter=XYZ
2a. Create variable // variablename -> prioOneCases
2b. Smart value // {{lookupIssues}}
3a. Create variable // variablename -> prioOneAll
3b. Smart value // {{lookupIssues.size}}
4a. Create variable // variablename -> prioOneSum
4b. Smart value // {{lookupIssues.customfield_10133.asNumber.sum}}
SEND EMAIL
Print all case Ids = {{prioOneCases}}
Print cases calculated all together = {{prioOneSum}} minutes
Print how many cases all together : {{prioOneAll}}
Print average fixing time : {{#=}}{{prioOneSum}} / {{prioOneAll}}{{/}} minutes
***** UPDATE*****
Thank you for help, this started to work as I wanted:
Create "extra" variable = safeDivisor
{{#=}} if({{lookupIssues.size|0}} > 0, {{prioOneAll.asNumber}}, 1) {{/}}
SEND MAIL
{{#=}} {{prioOneSum.asNumber|0}} / {{safeDivisor}} {{/}}
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.