...
Determine your search criteria to find pages. Verify the UI finds the right pages.
No Format title Example Example: "{macroname" NOT "{wiki}".
Construct an appropriate runFromContentList command similar to: How to globally search and modify content
No Format title Example --action getContentList --search " \"{macroname\" NOT \"{wiki}\" " --action runFromContentList --search " \"{macroname\" NOT \"{wiki}\" " --common " ... "
Test the modifyPage action on a test page
No Format confluence --action modifyPage --space xxx --title test --content "{wiki} \n " --content2 " \n {wiki}"
Construct the combined command similar to: How to globally search and modify content
No Format title Example confluence --action runFromContentList --search " \"{macroname\" NOT \"{wiki}\" " --space @all --common "--action modifyPage --space @space@ --id @pageId@ --content \"{wiki} \n \" --content2 \" \n {wiki}\" "
Alternatives
For people comfortable with SQL and having access to the Confluence database, runFromSql can be used as an alternative to find all the pages that need to be modified. There is a runFromSql example on How to automate adding text to Confluence pages. Here is some example SQL:
Code Block | ||
---|---|---|
| ||
select contentid from bodycontent, content where contenttype = 'PAGE' and version = (select max(version) from content as c where c.title = content.title) and bodycontent.body like '%name="table-plus">%' |