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)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.