I have a script to edit the text on a page
import com.atlassian.confluence.pages.PageManager import com.atlassian.confluence.spaces.SpaceManager import com.atlassian.sal.api.component.ComponentLocator import com.atlassian.confluence.core.DefaultSaveContext def oldText = '' def newText = '' def targetSpaceId = '' def spaceManager = ComponentLocator.getComponent(SpaceManager) def pageManager = ComponentLocator.getComponent(PageManager) def targetSpace = spaceManager.getSpace(targetSpaceId) def spacePages = pageManager.getPages(targetSpace, true) spacePages.each{page -> def pageBody = page.getBodyAsString() if (pageBody.contains(oldText)){ pageBody = pageBody.replace(oldText, newText) page.setBodyAsString(pageBody) pageManager.saveContentEntity(page, DefaultSaveContext.DEFAULT) log.info("Text replaced in page by Scriptrunner '${page.title}' in space '${targetSpace.name}'") } }
I would like it to be able to change the background link to a hyperlink on a Confluence page.
HI @Gaven Ray ,
Found an article that may help you with the problem you are trying to solve by adding html tags in your script.
Hope this helps.
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.