Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

CQL with special characters in page title

Pepe
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.
June 2, 2020

I'm struggling to figure out how to encode special characters in a CQL query against page title. I believe it'll be some magic combo of tricks that I haven't stumbled upon yet.

 

This is a start but doesn't work in my case: https://stackoverflow.com/questions/38730384/confluence-rest-api-search-error-with-encoding-cql-query-when-encoding

With title: Pepe "testing" CQL encoding

encoded as: Pepe %%22testing%%22 CQL encoding

I get the bad request response: 'message': 'Unrecognised clause at : "testing%"CQLencoding',

Using the page title verbatim: 'message': 'Unrecognised clause at : "testing"CQLencoding',

The request looks like this:

space = 'PRAE'
title = 'Pepe "testing" CQL encoding'
params = 'cql=space=%s and title=%s' % (space, title)
server_confluence_page = get('%s/rest/api/content/search?%s' % (confluence_server_baseurl, params))

 

It doesn't look promising: https://jira.atlassian.com/browse/CONFSERVER-55559

1 answer

0 votes
Pepe
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.
July 20, 2020

for posterity - I was fixing up links as part of a cloud to server merge project. The page names stayed consistent so I leveraged that. I abandoned this path and ended up building my own mapping of:

md5 hash of page title, cloud page id, server page id

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events