Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Using Script clone issue to new project based on current project

Alex Cumberland
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 30, 2019

First let me apologize as I am new to the JIRA administration side of things but I am still reading and learning.

So as part of our workflow we have a Post-Function transition that "Clones an issue and links it back to the original issue using the "Script Post-Function [ScriptRunner]".    This is used to copy customer entered issue from their project to the development team project to be worked.

For example:

      Customer project Issue is AAC-####  which then clones to the Development Team project as issue AAD-#### when approved by the project manager.

So in the parameters to this Post-Function step it has the "Target Project" selected as the AAD project.  It also has a list of specific "Fields to copy" selected as well to be copied to the new issue number under the Target project.

 

What I am wondering is if there were a script that could be written to do the same thing but expanded to handle multiple projects .

So that with multiple customers it could be set up with one workflow instead of having to maintain a workflow for each new customer brought on board since this step is currently limited to be from one project to another specifically.

For example:

AAC   would clone to AAD

BBC   would clone to BBD

CCC would clone to CCD

 

That way each customer project would clone their issue request over into the related development project based on the Customer project.

 

1 answer

1 accepted

0 votes
Answer accepted
Gonchik Tsymzhitov
Community Champion
August 31, 2019

As I see you can do it just creating multiple transitions with condition based on project key. 

Or another way is write own functionality of clone issue post-function in groovy 

Alex Cumberland
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 1, 2019

So if I am understanding what you are saying by multiple transitions is this:

In the the Post-Function[ScriptRunner] transition step I add into the "Condition" box the following code:

issue.projectObject.key == 'AAC'

And this would allow only this Clone function step to work if the issue was in the AAC customer project.

I  could then add the similar step in the same transition but with the other customer project key as the condition and it would only act if it was coming from that matching Customer but ignored for other customers.

So I would have a condition for each Customer BBC, CCC etc..... but could have them all in the same workflow.

 

If so this would help as the previous person set these transitions without the Condition and put them in separate workflows for each customer and it is such a hard time for me to try and maintain them when I have a change that is the same for all.

Suggest an answer

Log in or Sign up to answer