I setup an automation which is recurring each month and has a new issue as action.
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?
Hello @Klaus Ergert
This is the JSON that you need. Replace category1 with a valid Category value for your project.
{ "fields": { "Category": { "value": "category1" } }}
I have the same challenge but received the following error: Additional fields contains invalid field(s) in 'update' or 'fields' section: Category
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?
Hello @Trudy P 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.
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.
THe audit log shows:
And then in the ticket we have:
which then displays on the list as:
:necropost:
If you need to find the custom field ID, it shows up in the address bar (of the web browser) when you search for it in 'Custom Fields', click on on the three dots next to the field and then on 'View Field Information'. The number required is at the end of the URL in the address bar.
My example was this:
{"fields": {"customfield_10076": {"value": "Periodički"}}}
Of course substitute '10076' with your own field ID, as well as the value 'Periodički' with your own.
My use case is to cascade the parent category field to all its sub-tasks.
Referring to this link , it explained category is the special single select field, which not support direct usage in automation. This link explained it needs to use custom field method instead. However, it does not explain how to extract the custom field ID....
Researching Internet, the "All Work" issue list will come with export function. Exporting in xml can show your data in xml format. Reading the XML reverse engineering, you can see the similar data structure of category similar to below
<customfield id="customfield_11308" key="com.atlassian.jira.plugin.system.customfieldtypes:jwm-category"> <customfieldname>Category</customfieldname> <customfieldvalues> <customfieldvalue key="11337"> <![CDATA[ SAMPLE ]]> </customfieldvalue> </customfieldvalues></customfield>
In my automation "Edit work item fields" function, I defined the "Edit work item", and add the following in the options using JSON.
{ "fields": { "customfield_11308": { "value": "{{issue.parent.category.value}}" } }}
This can copy the field value of category from parent issue to the sub-tasks. It can be used under the Sub-Tasks branch.
Hope this help.... lots of research to resolve this issue, but I think it is very common to many people using Jira. The available information in web is limited, and I hope to tackle your one if it help.
It looks like you're new here. Sign in or register to get started.