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

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

ScriptRunner for Confluence- Delete page

Hey,

I notice that the api for delete page is deprecated

trashPage(AbstractPage page)

and the new api is :

trashPage(AbstractPage page, DeleteContext deleteContext)

Can anybody send an example how to get the object of "DeleteContext" (https://docs.atlassian.com/atlassian-confluence/6.1.0/com/atlassian/confluence/core/DeleteContext.html)

Thanks!

1 answer

1 accepted

Hi,

 

I have not tried it myself yet, but I had a quick look at the DefaultDeleteContext class and it seems to provide some meta data about the delete operation such as if it is a bulk operation or if notifications should be suppressed.

 

In that case I think you could just do something like:

Page page = pageManager.getPage(65547);

pageManager.trashPage(page, DefaultDeleteContext.BULK_OPERATION);
or
pageManager.trashPage(page, DefaultDeleteContext.DEFAULT);
or
pageManager.trashPage(page, DefaultDeleteContext.SUPPRESS_NOTIFICATIONS);

Hey,

Thanks, it works!

Suggest an answer

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

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

771 views 17 21
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