Get particular paragraphs on the Confluence page

Galina Grudinina
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 6, 2022

Hello, 
I have a Confluence page with 3 sections. Inside each section, the link to the Jira ticket can be added.
My task is to check each section for updates and if there are any I have to retrieve the titles.
Attaching the template of the page.

I've tried to call the endpoint below, but the response is very big.
url = "https://domain-name/confluence/wiki/rest/api/content"

I've also tried to call this, but the response is again too big:
If I use https://atlassian-python-api.readthedocs.io/confluence.html#page-actions  and try to call:
confluence.get_page_properties(page_id)
I'm not getting  enough info
I'm wondering if something from here will be useful, but I don't have space key: https://docs.atlassian.com/atlassian-confluence/REST/6.6.0/#content-getContent

Looking forward for someone's reply.
Thanks

 

 

1 answer

0 votes
Ziana Hanafi December 26, 2022

Hi @Galina Grudinina ,

Instead of calling all pages in Confluence via "https://domain-name/confluence/wiki/rest/api/content" you can try to limit the results by searching for keywords or labels using CQL (Confluence Query Language) like below: 

https://domain-name/confluence/wiki/rest/api/content/search?cql=text%20~%20"advanced%20search"%20AND%20label=docs

It will search for pages having "docs" as label and text "advanced search" in its body. Hope this helps!

 

-- Ziana

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events