We are encountering an issue when querying Confluence spaces using the CQL REST API. Our goal is to search for spaces where the title starts with collab-, specifically for dynamically identifying collaboration spaces.
The following query returns results as expected:
<span>/wiki/rest/api/search?cql=(type="space" and space.title~"collab-")</span>
However, when attempting to use a wildcard to match any titles starting with collab-, such as:
<span>/wiki/rest/api/search?cql=(type="space" and space.title~"collab-*")</span>
It returns no results.
Expected Behavior:
We expected that using the * Wildcard would return all spaces whose title starts with collab-.
Actual Behavior:
The query using collab-* returns no results, even though such spaces do exist.
Impact:
This behavior limits our ability to identify collaboration spaces with a consistent naming convention programmatically.
Steps to Reproduce:
Create a Confluence space titled collab-abc
Run the following query:
/wiki/rest/api/search?cql=(type="space" and space.title~"collab-*")
Observe that no results are returned.
Question:
Does space.title~ Support wildcards like * In CQL? If not, is there any alternative way to query for space titles starting with a given prefix?
Environment:
Confluence Cloud
CQL REST API- /rest/api/search
URL used:
<a href="https://test-confluence.net/wiki/rest/api/search?cql=(type=" rel="noopener nofollow noreferrer" target="_blank">https://test-confluence.net/wiki/rest/api/search?cql=(type=</a>"space" and space.title~"collab-*")
Let me know if you'd like a formatted Markdown or .txt version of this template!