Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to set issue category in automation

Klaus Ergert February 13, 2023

I setup an automation which is recurring each month and has a new issue as action.

Screenshot 2023-02-13 120010.png

Everything works fine but I also want to set the issue category to an already existing value.

The field itself is not available in the automation UI, there is this question where the field is referred to with {{issue.Category.value}}

https://community.atlassian.com/t5/Jira-Service-Management/Automation-rule-for-Issue-Category-field/qaq-p/2105656

---

When doing an JQL Query it is referred to as "Category[Category]"

I also tried with JSON but no success - can someone please help with this?

 

2 answers

0 votes
Mark Higgins April 16, 2024

Hello all,

Appreciate this is a long running question, but I have just managed to solve this for myself.

I used the customfield id. 


"fields": {
"customField_10160": { "value": "{{Object."Control Category".Name}}" }
}
}

So this is a JWM project, and the field Category[Category] is customfield_10160.

The value I am assigning comes from ASSETS, and so it needs to go btw quotes.

11Screenshot 2024-04-16 170610.png

 

THe audit log shows:alogScreenshot 2024-04-16 170828.png

And then in the ticket we have:

aaaScreenshot 2024-04-16 170946.png

which then displays on the list as:

1aScreenshot 2024-04-16 171121.png

 

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 13, 2023

Hello @Klaus Ergert 

This is the JSON that you need. Replace category1 with a valid Category value for your project.

{
"fields": {
"Category": { "value": "category1" }
}
}
Elizabeth Jones
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 14, 2023

I have the same challenge but received the following error: Additional fields contains invalid field(s) in 'update' or 'fields' section: Category

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 14, 2023

Hello @Elizabeth Jones 

Can you check your environment to see if you have more than one custom field named Category defined for the system?

Are you running the automation rule for a Team Managed project or a Company Managed project?

Can you show us the automation rule, the details of the Edit action, and the output in the rule audit log?

Nhật Đăng Lê
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 6, 2024

Hello @Trudy Claspill , thanks so much for your solution, I was trying to automatically assign a category based on keywords in the summary field, and stumbled on your answer. Within the "Edit issue fields" action, I can't find the Category field to simply add a value, and your JSON worked beautifully. I just need to select "Environment" as the field, set the option to "SET" and then use your JSON. Sharing for anyone else in need.
Screenshot 2024-01-06 164937.png

Eduardo Lello
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 19, 2024

Hi @Trudy Claspill I am having the same issue as @Elizabeth Jones - I set the rule as above and got the same error. I have this category created and I can select it manually in the list view or on a ticket. Not sure what's wrong. Thank you in advance!

Untitled 5.png

Eduardo Lello
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 19, 2024

I also tried using changing 'fields' to 'field' in the Additional fields text box's code above which seemed to fixed the error but now on the audit log it says some errors. attaching the error log here... Not sure what it's wrong. Attaching here some more screenshots:

 

Untitled 7.pngUntitled 6.png

 

Thank you!

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 21, 2024

Hello @Eduardo Lello 

It should be "fields", not "field".

Can you check your environment to see if you have more than one custom field named Category defined for the system? You can determine this by going to the View all issues page under the Filters menu, then enter a JQL statement. Start typing in category and Jira will show you all the fields that have that as part of their name. Check if more than one field is being suggested with the name just Category.

Are you running the automation rule for a Team Managed project or a Company Managed project?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events