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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Filter for label in a formula in Structure

I would like to create a formula column in Structure which filters for all issues which have a specific label. E.g. if I search for "Apples" it should find all issues where one of the labels is "Apples", e.g. "Apples, Oranges", "Apples, Pears", and "Apples".

I only manage to create a formula which finds issues where the only label is "Apples", but not issues which contain other labels as well.

Any suggestions which formula to use?

1 answer

1 accepted

0 votes
Answer accepted

Hi Martin,

The simplest approach here would be 

IF (SEARCH("Apples", labels) AND !SEARCH(",", labels), "Only apples")

Here it takes advantage of the fact that 0 and undefined are considered false value, so !SEARCH(",", labels) returns 1 if there are no commas in labels string, which means there is only one or no lables at all, for any number it will return 0.

Regards,
Egor Tasa

ALM Works

Thank you very much, Egor! I have the impression though that I don't need the second part AND !SEARCH(",", labels), "Only apples"), the formula seems to work with only the first part

Hi Martin,

Not sure that SEARCH("Apples", labels) would work as you expected, but you reminded me of MATCH(labels, "Apples") function that should indeed be sufficient.

Regards,
Egor

Actually, MATCH was my first thought, but that one works only when the labels field contains "Apples" only. That's why I was looking for an alternative, and SEARCH works perfectly. Thanks again!

Sorry, Martin, misread your original requirement. Glad that I could help despite that though.

Cheers,

Egor

Like Martin Härri likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

97 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you