Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Is there a way to bulk update user mentions (from one user to another) using Power Scripts?

We have a user mentioned on each page in a particular space which is used for our comala approval workflows.

We are facing an issue where an employee who was an owner on hundreds of pages has left the company and now we need to open each page and change their user mention to whoever now supports that product in our department.

Is there a way to use Power Scripts for Confluence to read all pages in a space for a particular user mention and then update it to another value?

Thanks in advance.

Kat

1 answer

0 votes
Davin Studer Community Leader Jan 14, 2021

You could use the selectPages routing to get a list of the pages in the your space and then loop though that list for each page. The below code is from their documentation ... modified slightly to edit the page content. You will need to know what the portion of the storage format is that you want to change. You should try this out in a full copy test version of your production system before kicking it off.

string cql = "(type=page and Space=DEV)";
number [] pages = selectPages(cql);
 
for(number p in pages) {
    %p%.content = replace(%p%.content, "", "");    
}

https://anovaapps.atlassian.net/wiki/spaces/PSCONF/pages/1840928/selectPages

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

198 views 0 6
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you