Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,368,351
Community Members
 
Community Events
168
Community Groups

What is the smart value for project category?

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

3 answers

1 accepted

6 votes
Answer accepted

From Atlassian Support, this is the correct Smart Value:

 

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

Awesome! Thanks for sharing this!

Ste

Like Alis likes this

Thanks, @Joe 

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

__Bill

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

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

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

Totally agreed

Actually a simple microservice doing autocompletion would be awesome 😎

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 Wim Matthijs likes this

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

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.

Hi @Alis 

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

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

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

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

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

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

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."

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

{{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

Atlassian Community Events