Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Scriptrunner CopyProject script does not work properly

Thread executorThread = new Thread(new Runnable() {
void run() {
def copyProject = new CopyProject()
def inputs = [
(CopyProject.FIELD_COPY_ISSUES) : true,
(CopyProject.FIELD_COPY_VERSIONS) : true,
(CopyProject.FIELD_COPY_COMPONENTS) : true,
def errorCollection = copyProject.doValidate(inputs, false)
if(errorCollection.hasAnyErrors()) {
log.error("Couldn't create project: $errorCollection")
else {
def util = ComponentAccessor.getUserUtil()
def adminsGroup = util.getGroupObject("jira-administrators")
assert adminsGroup // must have jira-administrators group defined
def admins = util.getAllUsersInGroups([adminsGroup])
assert admins // must have at least one admin


So i have a requirement lately about giving the ability to a limited group of users to copy a template project with the use of this script. Of course there are some more extensions behind it but they are not necessary to mention them currently. 

The current script can copy the project with the name and key correctly. Also the versions and the Components are copied too. I am straggling to find out why it doesn't copy the issues (Yes! the source project has iss.ues in it :P ). 

The jira-administrators group has 2 users . A default defined admin which i have from the install process which has all the permissions.

Jira instance is a pure fresh installed 8.3.2 version (i don't know if this creates the current problem.)

Any ideas my fellow Atlassians & Scriptrunner friends ???? Any workarounds maybe?



2 answers

1 accepted

0 votes
Answer accepted

Does it work when you run the Copy Project Script from the ScrptRunner UI under Built-In Scripts?

Basically yes. I even tried this script directly to the console and i have no results! :/

I tried your script (minus the executorThread) in my environment script console with a test project (contains 1 issue) and it worked.

Look in the Audit Log and see who the Author of the changes is. Then perhaps using the built-in script to change the active user to that user and try the built-in copy project script as that user. Are the issues copied?

If not, then look in the source project permissions scheme and make sure that your admin user has browse project and create issue permissions.

Like Christos Moysiadis likes this

@Peter-Dave Sheehan the funny is that it now works. The even more funnier is that the template project Create Permission was assigned to "Any logged user" . I changed it to the admin user and it seems to work correct now. 

Thnx for your help! :)


Hi @Christos Moysiadis ,

A concrete solution for this is defined here,

Best Regards,


Suggest an answer

Log in or Sign up to answer

Atlassian Community Events