Hi,
I'm in a situation where I have around 300 interlinked Confluence pages in which are embedded several instance of a macros that displays the result of a JQL query (sometimes showing the number of items, sometimes the issues themselves).
I've to _on a regular basis_ update all of these JQL queries (used by the macros) and this is a very tedious and time-consuming exercice knowing that there are round 3000 queries.
So, is there a way to programmatically access the content/structure of a given Confluence page and edit/modify one of the parameters of the macro (the JQL field) and perform the update? If yes, then programmatically, I would be be able to automate such updates.
Any inputs are welcome to address this challenge ;-)
Regards
Olivier.
Hello Olivier and welcome to the Community!
If you’re wanting to programmatically work through multiple pages within Confluence and update the contents of the pages and macro themselves then you’re most likely wanting to use the REST API. The REST API will allow you to make multiple changes to spaces, pages, and attachments through the use of scripting. With your example, I would approach this with the following endpoints:
Further information about using the REST API may be found at Confluence Cloud Developer | REST API.
I hope this proves helpful and you’re able to start updating your content easily.
Regards,
Stephen Sifers
Hello,
Many of our Confluence pages include Jira macros to return issue lists or issue counts. When we recently renamed components in our Jira instance, the Confluence Jira macros referencing the prior component names ceased to work, similar to what @Olivier Béghain describes in his original request.
I am attempting to use the REST API as suggested by @Stephen Sifersbut am so far unable to return just the pages which I need to update via the /wiki/rest/api/content/search endpoint. My request is as follows:
/wiki/rest/api/content/search?cql=macro=jira%20and%20text~%27component%20=%20Product%27&expand=space,history,version,ancestors,body.storage
where my CQL query is intended to return pages which include the Jira macro and whose body in Confluence Storage Format contains the text "component = Product" which I expect to find in the macro's JQL query string contents.
This approach is not working, and I'm wondering if it's a syntax problem or rather a limitation of Lucene and/or CQL, which may not be able to search based on "invisible" text such as the macro's JQL query string.
Any further guidance would be most appreciated.
Regards,
Patterson
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.