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

Search for labels with prefix on a confluence page

Hi,

I would like to search for pages with labels which are prefix with say characters OTB or otb. For example if page 1 has label OTB_First and page 2 has label otb_second, my search (CQL or Confluence search) for any page starting with OTB or otb, should give me 2 pages or even if give me labels - should give me OTB_First , otb_second

Any ideas?

Thanks,

Suresh

3 answers

Hi @Suresh Venkat ,

if you have the possibility to run a query against the database, here's your SQL:

SELECT c.title,s.spacename,l.name as label
FROM content c
JOIN spaces s ON s.spaceid = c.spaceid
JOIN content_label cl ON cl.contentid = c.contentid
JOIN label l ON l.labelid = cl.labelid
WHERE l.name LIKE 'otb%'
AND c.contenttype = 'PAGE'
AND c.prevver IS NULL;

@Nicolai Sibler : We are looking at how to display it on a page. Is there anyway, we can fire this query from a confluence page - may be via an REST/Macro. Do you know? Thanks for the query though.

Hi @Suresh Venkat If you have access to the database, the easiest way to find this information is through the database. (Make sure you have a backup of your database before performing any SQL query.) Refer this link on a sample query which you can modify as per your needs.

@Kishan Sharma : As you can see, we are looking to search and display on a page via a Macro or CQL. Any help can be provided will be appreciated 

As Brant mentioned, wildcard search for labels is not possible through the user interface currently. Either, you can export the query output from the database, and attach it to the confluence page or create a page using REST API and provide the exported output from the db query as an input (in json format) to the rest call.

0 votes
Brant Schroeder Community Leader Oct 13, 2021

@Suresh Venkat There is not a wildcard search for labels available in Confluence or Jira.  I was able to find an enhancement request for Jira but not for Confluence.  I would suggest submitting one here. https://jira.atlassian.com/secure/Dashboard.jspa

@Brant Schroeder : Thanks for the inputs. Can you please point us to the Enhancement that you have put in for Jira. We want to see, if it matches to our case. 

Brant Schroeder Community Leader Oct 15, 2021

@Suresh Venkat The enhancement request I was able to find for Jira is here: https://jira.atlassian.com/browse/JRASERVER-23038

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Confluence Mythbusters: Does Atlassian even use Confluence?

Hi, Confluence collaborators! As part of #Confluence-Collaboratory month, we’ve created a very special Mythsbusters segment, where we're dive into an interesting myth and uncover the truth behind i...

1,373 views 7 28
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