Find and alter confluence pages that not contains ...? - Command Line Interface

Hi!

I'm looking for the command to alter pages in a space that not contains the excerpt macro.

I'd like to add an empty or default excerpt.

I'm not shure if it is possible in a single command. Do i have to get a list of that pages before/as input for the storePage action?

And how to say: not contains excerpt.

Danke!

Matze

1 answer

There are a couple of approaches:

  1. A script to getPageSource to a file, read the file to search for {excerpt} and if not found, update the file to include the empty {excerpt}. Then storePage with the modified file. Do this for each page in the space. I have recently used this approach a site migration and will publish a sample groovy script in the next few days.
  2. If the data to be added is always at the start or end of the current page and you can query the Confluence database, then it is easier - see How to automate adding text to Confluence pages

Thank u Bob for the quick answer.

Now i see the way to getPageSource, modify and storePage.
To find pages already have excerpt will be easy. I'll try it tomorrow.
But what's with the rest, these without?
Have i overseen a way to negate the find result?
Do you mean i have to use sql to get these results? Or will the search parameter (confluence search syntax) do it for me?

Thank u!

Matze

Very difficult to say: NOT ;-)

"NOT excerpt" without any further search criteria...
But I think that will work (it does in confluence search): "type:page NOT excerpt"
I'll try it with your suggestions and the --search param.
TU!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

1,716 views 25 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you