Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Kathryn Smith January 11, 2021

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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 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
AUG Leaders

Atlassian Community Events