Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.

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

Custom Field that Counts # of labels in a label field

Christine Maurer
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!
February 18, 2025

Using Jira Product Discovery Project, I'd like to create a custom field in my ticket that counts the number of labels present in the "Labels" field in the ticket. Is there a formula/ function that I can use to get this count? 

2 answers

0 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
February 24, 2025

Hi @Christine Maurer,

if you're open to solutions from the Atlassian Marketplace, this would be easy to do using the app that my team is working on: JXL for Jira.

JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. It also comes with a long list of so-called smart columns that aren’t natively available, including the number of values of any labels field.

This is how it looks in action:

number-of-labels-2.gif

As you can see above, you can easily sort and filter by the number of labels, and also use it across JXL's advanced features, such as support for (configurable) issue hierarchies, issue grouping by any issue field(s), sum-ups, or conditional formatting.

This all just works - there's no scripting or automation whatsoever required.

I should add that this is not specific to JPD or JPD issues, but works in any of your Jira projects.

Any questions just let me know!

Best,

Hannes

0 votes
Aaron Pavez _ServiceRocket_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 18, 2025

Hi @Christine Maurer 

You can do something similar to this:

This smart value will return the size of the labels (how many)

{{labels.size}}

When: Value changes -> you can set this to something else if needed

and: Edit issue fields

custom field

add the smart value here

2025-02-18 15_00_24-Audit log - Automation - Discovery1 - Jira — Mozilla Firefox.jpg

2025-02-18 15_00_29-Audit log - Automation - Discovery1 - Jira — Mozilla Firefox.jpg

The audit log action checks if I get the right value. is the same smart value.

Hope that helps!

Regards

Suggest an answer

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

Atlassian Community Events