Automation for Rating field fails
Asked by Peter Lauri:

I have been trying to setup automation to set the value of a Rating field to "3". When creating the rule, the field is not found, so I'm creating an advanced update of the issue.

![Screenshot 2024-01-08 at 17.15.51.png](https://community.atlassian.com/t5/image/serverpage/image-id/299372iE3A5785D899614B9/image-dimensions/241x122?v=v2 "Screenshot 2024-01-08 at 17.15.51.png")

And then using the following rule, and I tried with value to be "3" and 3.

```
{
  "fields": {
    "Urgency": {
      "value": 3
    }
  }
}
```

It provides the following error log:

![Screenshot 2024-01-08 at 17.15.14.png](https://community.atlassian.com/t5/image/serverpage/image-id/299375i93FB09FBE76153B5/image-size/large?v=v2&px=999 "Screenshot 2024-01-08 at 17.15.14.png")

So I tried to find this custom field in administrator view, but this field is not possible to locate in https://\<domain\>.atlassian.net/secure/admin/ViewCustomFields.jspa

My conclusion is that the value is something else than just a value, but I cannot find the field to figure out the structure, so I'm screaming for help :)

Any ideas?


Answers:
author: Peter Lauri
body: The final solution includes what [@Nick H](/t5/user/viewprofilepage/user-id/2540930) stated in the below post, but to make it more condensed, I make a summary.

**Step 1** : In the Edit field rule, use the custom field ID, not the name. Find info about how to find custom field name [here](https://confluence.atlassian.com/jirakb/how-to-find-any-custom-field-s-ids-744522503.html).

```
{
  "fields": {
    "customfield_10083": 3  # replace with your custom field id!!
  }
}
```

**Step 2** : Assure the **Automation for Jira** user have permission to perform automation in your JIRA Discovery project. It was not possible to do by me as JIRA administrator, so JIRA support team made the changes for me. So if your rule does not work after setting the rule as per the above, [contact JIRA support](https://support.atlassian.com/contact/#/) to correct the Automation for Jira user permissions.

comments: author: Kevin Gough
body: Hi [@Peter Lauri](/t5/user/viewprofilepage/user-id/3977343) [@Nick H](/t5/user/viewprofilepage/user-id/2540930)

I'm trying to achieve the same thing but this isn't working for me at all despite following the steps.

**1.** Found the field ID for Impact using the issue navigator.

![Screenshot 2024-07-23 143859.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/337351i5F287DEBA760AF8D/image-size/large?v=v2&px=999 "Screenshot 2024-07-23 143859.jpg")

**2.** Created the rule using the same JSON as you.

![Screenshot 2024-07-23 143826.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/337353iCBA259335F8CC6FB/image-size/large?v=v2&px=999 "Screenshot 2024-07-23 143826.jpg")

**3.** Keep getting errors in the Audit log

![Screenshot 2024-07-23 143617.png](https://community.atlassian.com/t5/image/serverpage/image-id/337354iA690C2E49CF6C313/image-size/large?v=v2&px=999 "Screenshot 2024-07-23 143617.png")

**4.** Tried with another rating field and a slider field as I want to create automations for them too but same results.

**5.** Fairly certain *Automation for Jira* has permissions on the Discovery project as its executed other rules in the past.

![Screenshot 2024-07-23 144655.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/337357i26029D0684B4B5FB/image-size/large?v=v2&px=999 "Screenshot 2024-07-23 144655.jpg")

Any ideas why this is not working and what I could be doing wrong?

Thanks,

Kevin


author: Nick H
body: Hi [@Kevin Gough](/t5/user/viewprofilepage/user-id/4635543) ,

Your rule *appears* to be configured correctly - so my guess is your A4J (Automation 4 Jira) user does not have JPD permissions based on that error, and what other customers have reported.

Please open a ticket with JPD support [HERE](https://support.atlassian.com/contact/) or in JPD through the *Give Feedback* tab \>\> *Get help from the support team* option.

We on the Atlassian support team can get this user enabled / the correct permissions. Unfortunately this cannot be controlled from the customer's side.


author: Kevin Gough
body: Hi [@Nick H](/t5/user/viewprofilepage/user-id/2540930)

Appreciate the feedback, used the *Give Feedback* tab \>\> *Get help from the support team* option so hopefully they can sort me out soon.

Thanks,

Kevin


author: Nick H
body: Hi [@Peter Lauri](/t5/user/viewprofilepage/user-id/3977343) ,

The Urgency field is system field that I believe is not available for JPD out-of-the-box, like it can be selected for other Jira projects.

I was able to test successfully with a similar automation, and a custom Urgency (single-select) field with this type of rule:

![urgency1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/299385i226B7090C0F93A09/image-size/large?v=v2&px=999 "urgency1.jpg")

![urgency2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/299386i584ED9FD600E3FCD/image-size/large?v=v2&px=999 "urgency2.jpg")

In the example above, customfield_10210 is my custom Urgency (single-select) field. You should be able to find a field's ID by following this doc: [How to find any custom field's IDs](https://confluence.atlassian.com/jirakb/how-to-find-any-custom-field-s-ids-744522503.html)

One difference I noticed between our rules is the value ("L3") in my rule is surrounded by quotations while yours (3) is not.

We've also noticed that error related to the Automation-user, and it not having permission to perform actions for JPD. If after adjusting your JSON body to include quotations and the error persists, feel free to open a ticket with [JPD support](https://support.atlassian.com/contact/#/) and we'll take a deeper look into the issue.

comments: author: Peter Lauri
body: Hi [@Nick H](/t5/user/viewprofilepage/user-id/2540930)

The field is not of type Urgency, it is a "Rating field". And I cannot figure out what value options that field have, and I think that is the cause of the problem. I have tried "3" and 3. According to [the documentation](https://support.atlassian.com/jira-product-discovery/docs/jira-product-discovery-fields-reference/) the field have value from 1 to 5.

![Screenshot 2024-01-08 at 17.54.01.png](https://community.atlassian.com/t5/image/serverpage/image-id/299392iB240D2EFB40BA3FF/image-size/large?v=v2&px=999 "Screenshot 2024-01-08 at 17.54.01.png")


author: Nick H
body: Hi [@Peter Lauri](/t5/user/viewprofilepage/user-id/3977343) ,

Thank you for the additional information. The format of a rating field is actually a number so to your point, quotations would not be needed.

After an additional test with a similar custom field, I was able to get my automation working as expected with a body like this:

![urgency 3.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/299395i107F8E0E81DEF1B5/image-size/large?v=v2&px=999 "urgency 3.jpg")

![urgency4.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/299396iAB6081D4D109DE11/image-size/large?v=v2&px=999 "urgency4.jpg")

Where:

* customfield_10263 = Urgency 2.0 (custom rating field)
* JSON body is:

```
{
"fields": {
"customfield_10263": 5
}
}
```

Hope that helps!


author: Nick H
body: Hi [@Peter Lauri](/t5/user/viewprofilepage/user-id/3977343) ,

Thank you for the additional information. To your point, a Rating field is a number field and does not need quotations like a value might.

I was able to test with a similar custom-Rating field, and adjust my automation's JSON body to get this working as expected:

![urgency 3.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/299400i4AA3F3338A65C61D/image-size/large?v=v2&px=999 "urgency 3.jpg")![urgency4.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/299401iD5DCDCC231941252/image-size/large?v=v2&px=999 "urgency4.jpg")

Where:

* customfield_10263 = Urgency 2.0 (custom-Rating field)
* adjusted JSON body:

```
{
"fields": {
"customfield_10263": 5
}
}
```

Hope that helps! If you continue facing the same error, feel free to reach out to JPD support.


Tags: automation