Conflunece Cloud Content Property alias is not working

Hi folks,
I have the following configuration in my atlassian-connect.json

"confluenceContentProperties": [{
        "key": "content-properties-txr",
        "name": {
            "value": "TxR"
        },
        "keyConfigurations": [{
            "propertyKey": "txr",
            "extractions": [{
                "objectName": "isTxr",
                "type": "string",
                "alias": "travelreport"
            }]
        }]
    }]

I have then created a page which has the following property, added by an post request:
"key": "txr", "value": { "isTxr": "true" }

I also have a condition which shows a web item when this property is set. The condtion works flawlessly, so the property is added correctly. But I can’t get the cql search to work. The only response confluence gives me is the following: com.atlassian.confluence.api.service.exceptions.BadRequestException: No field exists with the name: 'travelreport' Did you mean one of : type, text, title. Here is the url including the cql string i used: /rest/api/search?cql=travelreport=true

Soooo, what am I doing wrong here?

Hi @Chief

Trying to rules somethings out. Can you help by providing a little more information to help with troubleshooting?

I have then created a page which has the following property, added by an post request:
"key": "txr", "value": { "isTxr": "true" }

Can you provide the post request you’re calling? I want to make sure there isn’t anything here that could be causing trouble.

But I can’t get the cql search to work. The only response confluence gives me is the following: com.atlassian.confluence.api.service.exceptions.BadRequestException: No field exists with the name: 'travelreport' Did you mean one of : type, text, title . Here is the url including the cql string i used: /rest/api/search?cql=travelreport=true

Does the SQL work if you use the following CQL expression:

/rest/api/search=cql=content.property[txr].isTxr=true

I know we’re trying to get the alias to work in the CQL statement … just trying to ensure that the property exists.

Thanks,
Ralph

Thanks for the fast reply!
I used the following code to add the property:

httpClient.post({
        url: `/rest/api/content/${contentId}/property`,
        json: true,
        body: {
            key: 'txr',
            value: { isTxr: 'true' }
        }
    });

When i use the CQL you are providing i get the following:

com.atlassian.confluence.api.service.exceptions.BadRequestException: Content properties query is invalid, verification failed for tokens: key

I did urlencode the cql string and replaced the equal sign with a question mark from your url /rest/api/search?cql=content.property%5Btxr%5D.isTxr%3Dtrue, otherwise I just get a 400 bad request with no body whatsover.

I still have not found a solution to this problem, could you maybe look into it again @rwhitbeck ?

So now that the Confluence Server Version will be destroyed I still want to know why this query does not work.

For additional testing I created a repo on github with a minimal example. It can be found here. I created this example with the cloud connect cli atlas-connect new <project_name> and then copied the example from the content property page into the atlassian-connect.json.
I tried quering using the following url:
https://api.atlassian.com/ex/confluence/{cloudid}/rest/api/search?cql=content.property[attachment].attachment.size<300 (url encoded of course) and I still get the same error:
com.atlassian.confluence.api.service.exceptions.BadRequestException: Content properties query is invalid, verification failed for tokens: key

So what am I doing wrong?

Thx in advance for anyone helping <3

1 Like