Morning,
I'm trying to create a scoring system for our issues. This is done by the person filling out the form entering a priority and severity value from lowest to highest (with low, medium and high in the middle).
I have then got a look up table relating these to values 1-5
I am then creating smart variables to lookup the value in the table that is provided in the issue.
{{#=}}{{Lookup.get(issue.Priority.value)}}{{/}}
{{#=}}{{Lookup.get(issue.Severity.value)}}{{/}}
I then use these issues in an if else block,
If {{severityValue}}*{{priorityValue}} is less than 5 show low
If {{severityValue}}*{{priorityValue}} is greater than 12 or either value equals 5 show high
Else show medium.
I can not get this to work however. I think it is the multiplication part of this that has become my downfall, I've tried many many variants of it and can't seem to get it to work. It just automatically goes to medium every time unless either input is highest so equal to 5. This returns a high
Thank you in advance
Hello, following the suggestion to log the variables I've managed to work out it was the priority field giving us an Issue due to us using the Jira field Priority rather than a custom field.
We've managed to solve it and I've had a mini celebration.
Thanks for all the help.
Hi Izzy,
Can you share the actual rule that you have now, showing the details of the field for the calculation?
Also, try adding some log actions to that will show you the value after to select it to be sure it is returning the values you expect it to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @John Funk
I'm currently using {{severityValue}} * {{priorityValue}} in the first value field on an if else block
Thank you I'll try adding some log actions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are not going to be able to put two values in the First Value field. You could create a variable using that calculation first, then use the variable name in the First Value field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok thank you, I have created a new variable to put the function in, however I can still not get it to work. If I use
{{severityValue}} * {{priorityValue}}
It just returns an error saying it is missing parameters
If I use
{{#=}}{{severityValue.multiply(priorityValue)}}{{/}}
It just returns the else option of the if else block when it shouldn't.
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.
Yes, and...to what John suggests...
In your rule, you are initially using an if-condition only rather than if-else clauses. That would cause processing to stop after the first condition. Please try changing your rule to something like this:
And also I wonder if your severityValue and priorityValue variables are correct, as you do not show the specifics of them in the rule images. Perhaps write those to the audit log after they are set to confirm the values.
Finally, rules can get a bit long in the browser, so consider using a screen capture or browser addon to create a scrolling page image of the entire rule. That will help for posting one rather than multiple images to show longer rules. Thanks!
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Bill Sheboy I've changed it to an if, else if and if and It's working slightly better. It is still stumbling on the formulas though. It now is returning low (The first option in the if) rather than anything else. I'll attach screen captures of all my variables. Thank you for the tip :)
As previously stated, just using a "*" is tripping up the automation entirely.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for that information. When you write the variables to the audit log, do you observe the values you expect?
Created variables are text, and need to be converted with asNumber before math operations, so that may also be a problem with the rule.
Regarding math operations, there are two formats which work: in-line and a math operation. For example:
{{severityValue.asNumber.multiply(priorityValue.asNumber)}}
or
{{#=}}{{severityValue.asNumber}}*{{priorityValue.asNumber}}{{/}}
And also...Using lookup tables does not require using the math operation: you use it directly like lookup issues:
One more: I recommend naming your lookups, and variables, with meaningful names to reduce confusion (for people and the rules engine). I would also avoid using reserved word names. In general, I prefix all of my variables and lookups with var, such as varSeverity and varScoreToNumber.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.