Is there any way to replace a specific text in all confluence pages of a space with a specific "excerpt include" which is defined in the space?
e.g. ###text### --> "excercpt include ###text###" in all pages.
The default search replace can only replace text with text.
Hello @Thomas Scheer ,
Yes, you can use Java API (https://developer.atlassian.com/server/confluence/) to do this.
You first get pages you want to apply changes to and then change their bodies.
E.g. in Groovy :
List<Page> pages = pageManager.getPages(...);
pages.each { page ->
def body = page.getBodyAsString()
body = body.replace("TEXT", "<ac:structured-macro ac:name=\"excerpt-include\"...</ac:structured-macro>")
page.setBodyAsString(body)
}
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.