Script runner post function to create/copy a project

Hi

Is it possible to create (or copy) a project on workflow post function?

I see there is Built in script for this action, but how can I use it in workflow.

My idea is create simple workflow that selects specific project template (created before) and copy this template to new project. Unfortunately I didn't find any info about it. Is it possible?

Thanks,

Fyodor

5 answers

1 accepted

Hi Fyodor,

I haven't ever actually tried this, and I don't necessarily recommend running this script as a post-function, but you should be able to get the actual content of the script by clicking ''view source'' after having selected the script in the builtin script field.

Put the copied script into your WEB-INF/classes/com/onresolve/jira/groovy/canned/workflow/postfunctions folder and change the

package com.onresolve.jira.groovy.canned.admin

for

package com.onresolve.jira.groovy.canned.workflow.postfunctions

Might require some hacking around but it's a start, depending on how familiar you are with groovy coding:

You can find a bit more info on how this would work here:https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Workflowfunctions-Post-functions

1 vote

You can use this post-function to do this: https://gist.github.com/jamieechlin/8240692

Obviously various params would be replaced by custom field values etc.

You could copy the source, but I don't really recommend it - multiple maintenance problems.

Hi Fyodor,

I haven't ever actually tried this, and I don't necessarily recommend running this script as a post-function, but you should be able to get the actual content of the script by clicking ''view source'' after having selected the script in the builtin script field.

Put the copied script into your WEB-INF/classes/com/onresolve/jira/groovy/canned/workflow/postfunctions folder and change the

package com.onresolve.jira.groovy.canned.admin

for

package com.onresolve.jira.groovy.canned.workflow.postfunctions

Might require some hacking around but it's a start, depending on how familiar you are with groovy coding:

You can find a bit more info on how this would work here:https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Workflowfunctions-Post-functions

You can use the CLI Plugin for JIRA and it's JIRA post function to run cloneProject, createProject, or similar actions.

Hi all

Thank you for advices, I will try scenarios you offered.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

800 views 2 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you