How to search value which stored by the status macro?

Aleksandr Paren August 22, 2019

Hello.

Sometimes I am using the status macro in my confluence pages.

Here the example

!_01.PNG

If I am trying to do the search this is page couldn't be found.

If I use CQL, the result will be with the pages which are withe macro, but not with the value which I wanted

macro+%3D+"status"

Is there some ways to find values in the status macro?

 

2 answers

0 votes
Aleksandr Paren August 23, 2019

Hi, @Diego . 

1. I need search result in the Confluence, I don't want to use REST API 

2. I wrote, I have the script 

macro+%3D+"status"

And unfortunately no any information in the Advanced Search Reference, how can I search values in the status messages

Only that example which also gives me result only with the pages where status macro used.

macro = status

As I am understanding for now there are no any possibility to search pages with the values in the status page macro inside. This is sad, because now I have to edit so many pages and insert standard text instead of status page macro. Finally it works that rendered value can not be found.

If I look into the rendered output HTML-code, I can see my message inside.

<span class="status-macro aui-lozenge aui-lozenge-complete conf-macro output-inline" data-hasbody="false" data-macro-name="status" data-macro-id="d828d53d-cd70-4650-886d-2b26fb7e2b03">THIS IS THE TEST STATUS MACRO</span>

 

 

 

0 votes
Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 23, 2019

Hello there Aleksandr!
We can use CQL and REST API to find the desired content. We can find the desired content on the page body itself.
Our query can look into the storage format and search for the desired string within your content, Aleksandr. This should work regardless of what we are looking for because we will look into the storage format, not the macro as a rendered product.

For this, we will need some REST API:

and also Advanced CQL search:

The request should look like this:

curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/search/user?cql={cql}' \
--user 'email@example.com:' \
--header 'Accept: application/json'

You will need API Tokens for that. Here is your documentation for it:


API Tokens are used as a mean of authentication for our Cloud platform when you are dealing with scripts or any other Cloud process.

Let us hear from you Aleksander!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events