Running groovy in /poutside Xwiki

During my “migrate” journey, one of the things I would like to do, it change the created date on pages/blogs - to the Confluence date of creation.

This is not possible via REST according to ChatGPT, but can be done in groovy (or possible a raw SQL)

For the groovy part, its seems it can “only” be run via a page - is that correct?

That approache seems kind of “wierd” - what if the page is reloaded - does the script run again?

So - is there a console funtion as Confluence Data Center has it?

ot can it be execures from the Ubuntu OS commandline - or can a script using the Java API be executes from the Ubuntu OS commandline

If anyone has the SQL to update a page/blog creation date, please drop it to me :slight_smile:

There’s no official console to do that unfortunately.

What I do personally, is create a page, type my script and click “preview”. I don’t save the page (unless I want to keep it, in which case, I put some protection in the script so that it doesn’t execute when the page is rendered).

For example:

{{velocity}}
#if ($request.confirm == '1')
...
#end
{{/velocity}}

Otherwise there are some old extensions that do what you ask but I have no idea if they still work or not:

There’s also the Gardening App which is close: https://extensions.xwiki.org/xwiki/bin/view/Extension/Gardening%20Application%20-%20UI/

Hope it helps

2 Likes

Thanks for the update