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

How can I update an issue's category via Automation?

Brock Jolet June 1, 2023

I've found a couple of similar posts, but they're not exactly what I'm looking for.

I am using Category in a JWM project because the "Group by:" options do not allow me to use Components or Labels or anything similar. However, I don't want to manually update every task and subtask when I assign a Category to an epic.

I want an automation rule that updates the children when the epic's Category is changed.

 

I am able to trigger a rule when the Category field changes. Then I perform a branch search for the following query:

parent in ({{triggerIssue.key}}) OR parentEpic in ({{triggerIssue.key}})

 But I cannot figure out how to copy the value from the triggerIssue to these other issues; Category is not an option in the easy field picker and everything I try in the Additional Fields section throws an error.

 

To use the field in a filter, it's formatted as "Category[Category]", but using {{issue.Category.value}} appears to work as a smart filter.

2 answers

1 accepted

2 votes
Answer accepted
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 1, 2023

The category is a special custom field, and can only be set by using the More options and the advanced field editing. You need to find the ID for the category you want to set, one way of doing that is to have manual triggered automation that has a log action that you set to {{issue.Category}}.

This is what the JSON would look like to set the Category:

{
"fields": {
"Category": {
"id": "<Category Id>"
}
}
}
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 1, 2023

And if you are copying the category from the trigger issue the JSON would look like this:

{
"fields": {
"Category": {
"id": "{{triggerissue.Category.id}}"
}
}
}
Like # people like this
Brock Jolet June 1, 2023

Thanks, @Mikael Sandberg ! That worked perfectly!

Like Mikael Sandberg likes this
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 receive the following error: Additional fields contains invalid field(s) in 'update' or 'fields' section: Category

Daiane Noble
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!
April 21, 2024

@Mikael Sandberg Thank you a million times for the answer that actually worked. I found so many posts with other formats that didn't work and I was losing my mind. This is a lot simpler than having to find the custom field ID, and this page in the documentation does not even mention it: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/

 

Do you know of any article that actually explains this is the right way to go about it?

 

Thank you!

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 13, 2024

@Elizabeth Jones This might be a bit late, but I missed your post, and just discovered that I also get the same error. It looks like now you have to use the custom field Id instead of the name, so the JSON should look something like this:

{
"fields": {
"customfield_xxxxx": {
"id": "<Category Id>"
}
}
}
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.
June 1, 2023

Hello @Brock Jolet 

When asking for help with an Automation Rule you have constructed it is very helpful if you post an image that shows all the steps in your rule.

In general if you are triggering a rule based on a change to a "parent", then the way to cycle through and update the "children" is to use the Branch option. You can use Branch For Related Issues Subtasks to update the direct subtasks of an issue. If the trigger issue is an Epic then you can use Branch For Related Issues Stories to update the child issues of the Epic.

Screen Shot 2023-06-01 at 10.44.19 AM.png

If the subtasks are under the child issues you will need to create two rules; one triggered by the change in the Epic and updating the child issues, and a second triggered by the change in the child issues and updating their subtasks, because Automation rules don't support nesting branches.

Brock Jolet June 1, 2023

Thanks, @Trudy Claspill . I ended up using the JQL from my post to avoid needing two rules. The suggestion from @Mikael Sandberg helped me with the last bit that I needed.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events