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 votes

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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,110 views 13 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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot