Assign value automatically, when another value is calculated via JIRA automaton
Asked by Lukas:

Hi folks! I have 4 custom fields (Impact, Likelihood, Risk score and Risk rating). Impact and Likelihood are single choice dropdown fields, where predefined values are stored. Based on those values of what you have selected, Risk score is automatically calculated via automation. Based on Risk score, Risk rating should be assigned again automatically.

For example, if Risk score is equal 4 or less, Risk rating should get the value LOW. If Risk score is between 5 and 9, Risk rating should be MEDIUM and so on. But my automation didn't work, however when I manually type Risk score and hit ENTER, it works. What should I change, that the Risk rating get automatically a corresponding value?

Here are the fields:

![risk calculation.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/207964i88790CB2ABE20482/image-size/large?v=v2&px=999 "risk calculation.PNG")

As you can see, Risk score calculation automation works, but Risk rating allocation automation not.

Here is my Risk score calculation automation:

![risk score calculation-1.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/207966iA6CBBF95D59D7E3E/image-size/large?v=v2&px=999 "risk score calculation-1.PNG")![risk score calculation-2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/207967i8AB5C93D73A73DCB/image-size/large?v=v2&px=999 "risk score calculation-2.PNG")

And here is the second automation, which didn't work:

![risk rating-1.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/207970i34FABDCA318C1C19/image-size/large?v=v2&px=999 "risk rating-1.PNG")![risk rating-2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/207971i2CC21AE85F4E7876/image-size/large?v=v2&px=999 "risk rating-2.PNG")![risk rating-3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/207972i9074EC037ADE6A25/image-size/large?v=v2&px=999 "risk rating-3.PNG")![risk rating-4.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/207973i8D0434059EAFAA12/image-size/large?v=v2&px=999 "risk rating-4.PNG")![risk rating-5.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/207974i2446A533A4C21671/image-size/large?v=v2&px=999 "risk rating-5.PNG")


Answers:
author: Bill Sheboy
body: Hi [@Lukas](/t5/user/viewprofilepage/user-id/3851094)

You seem to have 2 rules, one which makes field changes that could trigger the other rule.

By default, automation prevents that to avoid errors/run-away rules. You can enable this for the second rule by looking in the details at the top and enabling the option "Allow Rule Trigger".

Kind regards,  
Bill

comments: author: Lukas
body: Thank you [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) . It has worked. A question: is there any way to prevent that the calculated value gets manually changed by user after the calculation? For example impact is 2, likelihood is 2, it gives me the risk score 4, therefore my risk rating gets automatically assigned the value LOW. But if I change manually the risk score to 8, risk rating will change to MEDIUM, which is technically correct, but not what I want.

So basically risk score should be automatically calculable, but not manually changeable. What do you think about the idea?


author: Bill Sheboy
body: I have not tried that, although I recall some posts about making fields that can only be set through automated rather than manual changes. If you do not need to see the field Risk Score, you could either eliminate it (using one rule) or use an entity property to conceal it.

Alternatively to keep the Risk Score visible...a work-around is a modification to your rule which detects a change to the field:

* checks the {{initiator}} as the user who made the change with a user compare (or advanced compare)
* and if the user was anyone other than the Automation User...
  * set the field back to the prior value using the change log, and
  * perhaps either log a comment or notify the user


Tags: calculated-field