Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Determine your search criteria to find pages. Verify the UI finds the right pages. 

    No Format
    titleExample
    Example: "{macroname" NOT "{wiki}".
  2. Construct an appropriate runFromContentList command similar to: How to globally search and modify content 

    No Format
    titleExample
    --action getContentList     --search " \"{macroname\" NOT \"{wiki}\" "
     
    --action runFromContentList --search " \"{macroname\" NOT \"{wiki}\" " --common " ... "
  3. Test the modifyPage action on a test page 

    No Format
    confluence --action modifyPage --space xxx --title test --content "{wiki} \n " --content2 " \n {wiki}" 
  4. Construct the combined command similar to: How to globally search and modify content 

    No Format
    titleExample
    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
titleId of latest version of pages containing search string
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">%'