Bulk search/replace text within Confluence pages under specified parent page.

Daisuke Niwa January 5, 2013

Hello,

We would like to search and replace texts within Confluence pages under specified parent page.

Let's say we've got following page structure,

Parent page

--Child page 1 (contains text "a")

--Child page 2 (contains text "a")

--Child page 3 (contains text "a")

We would like to replace text "a" within child page 1 to child page 3 with text "b" at once.

Is there any remote API available to achieve this, or do we need to create plugin for this purpose? Please advise.

Regards,

Daisuke Niwa

1 answer

1 accepted

0 votes
Answer accepted
Renjith Pillai
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.
January 5, 2013
I can think about using the Confluence CLI and a bit of scripting to do it. Download the content as wiki, do search and replace and upload it back.
Daisuke Niwa January 5, 2013

Thank you for your response. I went through the documentation of Confluence CLI but could not find a method to replace certain character.

https://bobswift.atlassian.net/wiki/display/CSOAP/Documentation

Is it possible for you to let me know which method I should use?

Regards,

Daisuke Niwa

Daisuke Niwa January 5, 2013

Actually, "storePage" methold supports "findReplace" parameter which finds and replaces text within Confluence page.

Daisuke Niwa January 5, 2013

Thanks, that helps!

Renjith Pillai
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.
January 5, 2013
Ah no, I meant to write a script which uses CLI. Do this in the script: 1. Use CLI with getPage option first, it will write a file 2. Do the replace operation in a file, there are famous perl one liners for that or use sed 3. Use CLI with storePage option and upload back to Confluence.
Renjith Pillai
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.
January 5, 2013
Ah great. That makes it easy.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events