Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How do I use ~ (CONTAIN) JQL operator with Label field

Edited

Hi,

I want to use ~ (CONTAIN) JQL operator in my JIRA query on Label field to search for any label, that contains specific phrase.

AND labels ~ 'ServiceNow'

Is it possible ? Thanks

3 answers

2 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 16, 2022

I think "contains" is misleading in the name of the function, it's more "like" than "contains".  The English version of your query is closer to "and there is a label like 'ServiceNow'"

But the answer is a simple "no".  ~ searches for text in text fields.  Labels are a set of fixed terms, a select list rather than text.

Thanks. It explained why I cannot use it.

1 vote
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 16, 2022

Hi @AGnieszka GRodzka 

Did you try what you have in your question? Did it work? If not, what was wrong? 

@Nic Brough -Adaptavist-  replied to me and it explained the issue I have. Yes I tried, and syntax did not work.

Like John Funk likes this
0 votes
mauricio.groth
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.
May 18, 2022 • edited Jul 11, 2022

Hi @AGnieszka GRodzka

As you're on Jira Cloud, the correct answer is to get an app that provides JQL extensions you're looking for.


With standard JQL, you can only get a list of issues and export them to Excel for further processing. This works if you want to do a one-off analysis. If your use case is more dynamic than that, look beyond standard Jira.

Standard JQL doesn't easily allow it, but you can quickly find the results using our professional indexing service JQL Search Extensions

 

Using this query will show any issue that contains a specific phrase in the label field:

 

issue in wildcardMatch("labels", “*ServiceNow*”)

Check out the documentation for more examples.
I hope this helps!
Maurício

I wonder what the technical reason is Atlasian has not implemented ~ for labels? It is implemented for several other fields. As a workaround to a sensible implementation in JQL I have to install a plugin or do a cumbersome JQL workaround where I have to check for all my labels (of which I can have many - in my current example I have around 20).

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 12, 2022

It's a weird field to me - it is sort of text but not really because it becomes a list of values, also. But it's not a true list of values to me, either. But it is closer to that than text, which is what uses the ~

Like zaburko likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events