What is the smart value for project category?

Joe August 16, 2020

I'm trying to set up a jira automation rule based on project category.  Is there a smart value for this field?

5 answers

1 accepted

8 votes
Answer accepted
Joe August 17, 2020

From Atlassian Support, this is the correct Smart Value:

 

{{issue.fields.project.projectCategory.name}}
Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 17, 2020

Awesome! Thanks for sharing this!

Ste

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.
August 18, 2020

Thanks, @Joe 

I hope that the smart value documentation will eventually centralize this information and align it with the REST API output.

__Bill

Like Josh Simnitt likes this
Wim Matthijs October 8, 2021

can't get it to work, can anybody tell me how exactly this is supposed to be implemented in an automation?

Wim Matthijs October 8, 2021

Ok seems to be because i'm coming from a release trigger.
if you are coming from a release the smart value is as follows:

{{version.project.projectCategory.name}}

Like Bill Sheboy likes this
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.
October 8, 2021

Thanks, @Wim Matthijs 

I really wish there was a comprehensive smart value glossary: https://jira.atlassian.com/browse/JIRAAUTOSERVER-103

Rule writers waste lots of time hunting around for answers and the correct context to get at the information in Jira.

Kind regards,
Bill

Like # people like this
Wim Matthijs October 10, 2021

Totally agreed

Wim Matthijs October 10, 2021

Actually a simple microservice doing autocompletion would be awesome 😎

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.
October 11, 2021

Yes, lots of opportunities to improve the automation rule editor.  I'd like at least some syntax validation prior to save.  (another example: Watch out using RegEx in rules, as some invalid expressions lock up the rule editor when the engine attempts to parse them, preventing a save!)

Like # people like this
Wim Matthijs October 11, 2021

Thanks for the pointer, didn't use regex so far yet, and will be careful when i do!

Alis-Hathway Ward (DO NOT USE) August 9, 2022

EDIT: Text-based matches for these smart values may be case-sensitive for cloud automation rules that are triggered by create issue. If your rule recently started failing, it might be due to that, rather than a change to the smart value logic itself.

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.
August 9, 2022

Hi @Alis-Hathway Ward (DO NOT USE) 

I just retested this one and it works for Jira Cloud when the context is an issue and the project has an assigned Project Category.  Otherwise it returns null.

{{issue.project.projectCategory.name}}

Kind regards,
Bill

Alis-Hathway Ward (DO NOT USE) August 9, 2022

Very strange. It's certainly not working for me. Is there something super obvious to you that I'm not seeing wrong with my rule? I'm the site admin, so I can confirm with 100% surety that my category drop down includes choices for both hybrid and native and that the option is selected in the project config. 


Audit:
IF BLOCK
The following issues did not match the condition:
 IF/ELSE BLOCK
The following issues did not match the condition:


When: Issue created
Rule is run when an issue is created.
If: matches
{{issue.project.projectCategory.name}} contains hybrid

Then: Edit issue fields
Components
Add component

Else-if: matches
{{issue.project.projectCategory.name}} contains native

Then: Edit issue fields
Components
Add component

Alis-Hathway Ward (DO NOT USE) August 9, 2022

I was able to get it working when I inspected the drop down list and passed instead {{issue.project.projectCategory.id}}.

I don't know why that works and not name, but I will take it. My guess is case-sensitivity, which I've noticed JIRA has lately cared about for certain query params.

Thanks, Bill, for the help.

Like Bill Sheboy likes this
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.
August 9, 2022

I am glad to learn you got that to work.  

One more thing to try if you still want the name attribute: The Issue Created trigger can start the rule before all of the data is available.  This is a known timing issues for Jira Cloud.

The work-around is to add a Re-fetch action immediately after the trigger.  This will slow down the rule and reload the issue data before trying to use it.

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.
August 17, 2020

Hi @Joe 

Please try the guidance below to find an unlisted/undocumented smart value, using the REST API to capture an example issue:

https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/

Note that if this does not provide an exact match, it may get you close enough to experiment and find the name.

Best regards,

Bill

0 votes
Celina Kincaid
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 17, 2024

I could never get {{issue.project.projectCategory.name{}}} to work either.  Used correct case, tried in quotes, without quotes, stood on my head, etc.

I gave up and did {{issue.project.projectCategory.id}}.  It's now working.

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.
January 17, 2024

Hi @Celina Kincaid -- Welcome to the Atlassian Community!

If you did try this:

{{issue.project.projectCategory.name{}}}

The reason that did not work is the extra curly brackets after name.  Please try this instead:

{{issue.project.projectCategory.name}}

Kind regards,
Bill

0 votes
Amy McCann December 15, 2022

Any update on this one?

I have tried LOTS of different iterations and can't get anything to pull back the Project Category.

YES {{project.name}}
NO {{project.projectCategory.name}}
NO {{project.projectCategory}}
NO {{project.projectCategory()}}
NO {{project.projectCategory.name()}}
YES {{issue.project.name}}
NO {{issue.project.projectCategory()}}
NO {{issue.project.projectCategory.name()}}
NO {{issue.project.projectCategory}}
NO {{issue.project.projectCategory.name}}

NO {{issue.fields.project.projectCategory.name()}}

NO {{issue.category}}
NO {{issue.category.name}}
NO {{issue.category.name()}}
NO {{issue.project.projectCategory.id}}

Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 26, 2022

Hi @Amy McCann 

I just tried...

{{issue.fields.project.projectCategory.name}}

...and it works for me.

Assuming you've checked the Project has a Project Category, could you give us the full rule details so we can try to replicate your issue?

Ste 

0 votes
Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 16, 2020

Hi @Joe 

I envision it's something like {{project.category}} if it exists - or perhaps {{issue.project.category}}?

How are you looking to utilise the category? If you provide more specifics about the rule, it'll help us find a solution to your overall need :)

Ste

Joe August 16, 2020

I've tried both of those and neither of them work.

I'm not looking for advice on how to come up with a solution to my problem.  I'm just asking a simple question:

Is there a smart value for the project category field?

For context, the JQL syntax for this field is "category."

Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 16, 2020

Hi @Joe 

If isn't working with the options I suggested above - I tried them also in a test instance - it might not be available.

{{issue.project.XXX}} is how you access an issue's project information via smart values.

I know this is Server documentation, but this page on Smart Values doesn't mention it under the "issue.project" section.

Ste

Joe August 17, 2020

{{issue.project.category}} didn't work either.

Suggest an answer

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

Atlassian Community Events