Hello Atlassian Community!
I've got a question related to ScriptRunner and its canned scripts in Confluence.
I have implemented a custom REST-Endpoint recently. This REST-Endpoint calls one of the Built-In scripts provided by scriptrunner. It does so by importing
import com.onresolve.scriptrunner.canned.confluence.admin.CopyTree
and executing the following block:
def copyTree = new CopyTree()
def errorCollection = copyTree.doValidate(copyTreeInputParameters, false)
with parameters:
[ (CopyTree.FIELD_SRC_PAGE_ID) : [sourcePageId.toString()],
(CopyTree.FIELD_TARGET_PAGE_ID) : [space.getHomePage().getId().toString()]
]
Since the upgrade to ScriptRunner version 6.6.0 from 6.3.0-p5, this is not possible anymore, because the constructor is not found. Calling these scripts from a REST-Endpoint is not officially supported by ScriptRunner, and therefore this is understandable that the API can change.
(Here is the error)
groovy.lang.GroovyRuntimeException: Could not find matching constructor for: com.onresolve.scriptrunner.canned.confluence.admin.CopyTree()
Nonetheless, I'd like to be able to copy this pagetree from one project to another in the REST-Endpoint.
Any help on either of the points below would be greatly appreciated:
- An alternative way on calling this canned script
- An alternative way on copying a pagetree inside the REST-Endpoint
Thank you for your time!
Simon Neuville