Automation -> Issue field condition -> field "Category"

Lukas Maas April 17, 2023

Hi fellows,

I have a question:

I want to automatically create subtasks when I change the issues category to a specific value.

I'm adding a "issue field condition" Component to the automation workflow - everything's fine so far.

But I can't select the "Category" field - it's not available in the dropdown suggestion menu.

I saw that the "Category" field is locked - is this the reason? When yes, why can't I use this field?

Yes I can use Labels instead, but it is not 100% clean for my project.

I can't select "Category" here.

Jira_Category.png

But I can select it at the "field value changed" component

Jira_Category_ValueChange.png

 

7 answers

1 accepted

0 votes
Answer accepted
Lukas Maas April 17, 2023

I found a solution: instead of using the category field I used {{customfield_13953.value}} - this works with the advanced compare condition.

Thanks for your support!

1 vote
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 17, 2023

Hi @Lukas Maas 

When a field is not yet supported with the built-in list for Issue Fields Condition, please try the Advanced Compare Condition and use the smart value for the field

To confirm you have the correct smart value for your field (and that it is supported by rules) please use this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Kind regards,
Bill

Lukas Maas April 17, 2023

Hi @Bill Sheboy 

Thanks for your advice - unfortunately I already tried this before, but it didn't work.

Maybe I used the wrong property? But I couldn't find the category's properties anywhere. Do you know which property I should use?

I tried {{issue.category.name}} {{issue.category.key}} 

Jira_Category_properties.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2023

To identify the correct smart value (and confirm rules support it), please use the how-to article I provided.  Essentially what you do is:

  • identify an example issue with your field
  • call the REST API from a browser
  • search for your field on the page
    • if you find it, you can confirm the smart value (or custom field id)
    • if you do not find it, the field is not supported by automation rules
1 vote
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 17, 2023

Welcome to the Atlassian Community!

Category is a weird field, it's a field type provided by JWM, and there's two of them. 

One of them is a project category, and it only really gets used in search (you can say "category = X", and it will select for all issues in all projects currently in the project category).  This one isn't a problem here, you don't really see it anywhere else.

The one you are interested in is a field that effectively only exists for Jira work management (business) projects, and it's not the same as other, more simple field types.

Automation has not yet been coded to work with it.  I know there are request for it to be done, and they are high on the to-do list, but I haven't bookmarked the link (yet)

Lukas Maas April 17, 2023

Thanks Nic for your quick and informative reply.

I felt that this field is a little bit weird too.

If it's not coded into automation - why it is available on the "field value changed" component and not under "issue field condition" - this makes absolutly no sense for me. 

I can cheat if i abuse the labels, but labels are not the same like a category - and for a big project it will just create other problems.

Thanks for welcoming me to your community!

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 17, 2023

Ah, that might be an improvement actually, when the field first arrived, I don't think you could use it in the "field value changed" either!

There's a technical essay on how fields work internally in the code, but the short version is that a field is a self-contained object with interfaces to the rest of the code to talk to.  If a field does not have a relevant interface, the other stuff can't talk to it, and if the field needs to be talked to in a different way, the other stuff needs to be coded to understand it.

Automation seeing Category in "field value changed" means that either Automation has had the right calls to the Category field type added, or, more likely, the interface to ask the question "have you been changed?" has been implemented in the field!

And next, we need the "list yourself in 'issue field condition'" added to one side or the other

Like Lukas Maas likes this
Lukas Maas April 17, 2023

I got you and totally agree!

I just can't imagine an use-case where you trigger anything if the category changes without knowing its (new) value. But that doesn't mean that it does not exist :)

Thanks again for your reply!

0 votes
alevy
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!
November 1, 2023

I was trying to create a similar automation as Lucas Maas for a change of category. I found a workaround using {{fieldChange.toString}}. Worked exactly as needed.Capture.PNG

0 votes
Lukas Maas April 17, 2023

Maybe there is another way to accomplish my automation requirements - this is the workflow:

When I'm creating a new (parent) issue:

if category == A then create Subtask A, B, C for this issue

if category == B then create Subtaks X, Y, Z for this issue

0 votes
Lukas Maas April 17, 2023

I added this comment to my post

0 votes
Lukas Maas April 17, 2023

I added this comment to my post too

Suggest an answer

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

Atlassian Community Events