Forums

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

Auto-clone jira issues from one project to another

Iro Karavasili
Contributor
September 8, 2020

Hello all -

I am using ScriptRunner for jira (version 5.5.5) , trying to auto-clone issues from one project to another under specific conditions.
I followed some guidelines I've found to create such a post-function but I could not make it.

What I am specifically trying to do is:

whenever a customer ticket (type in (Bug,Improvement) AND "Service case id" is not EMPTY AND blocking =Name) of the ProjectA  is turned to "Resolved" with resolution=fixed, a clone on the ProjectA to the ProjectB should be created automatically and vice versa.

Probably for the cloning we'd need to fill in the "version" field. If it is not trivial to get the latest version of each project, then we just put a specific version eg "version1".

Could someone help?

Thanks is advance,
Iro

1 answer

1 accepted

1 vote
Answer accepted
Gustavo Félix
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 9, 2020

Hi @Iro Karavasili 
I think this is a complete answer for what you are looking.
https://community.atlassian.com/t5/Jira-questions/Create-issue-in-another-project-with-Script-Runner/qaq-p/586820

Let me know if it helped you.

Iro Karavasili
Contributor
September 21, 2020

Thank you @Gustavo Félix , this was really helpful.
What I am also trying to do is to add some Conditions when cloning the issue.
I use this:

cfValues['Service Case ID'] != null && cfValues["Blocking"] == "ABC"
But it didn't work.
As far as I understand the problem is here cfValues["Blocking"] == "ABC"

When I use the first part of the condition cloning works fine.
When I add the 2nd condition (even without the 1st part) cloning does not work.
I also tried to use cf's id with no success:

cfValues[12345] == "ABC"

Could you help with this?

Gustavo Félix
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 21, 2020

What field type is cfValues["Blocking"]  ? @Iro Karavasili 

Iro Karavasili
Contributor
September 22, 2020

@Gustavo Félix it is a custom field

image.png

Gustavo Félix
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 22, 2020

Yes, but is it a textfield , a select, checkbox, etc ?
It changes the way you can get the value.

Iro Karavasili
Contributor
September 22, 2020

It's a checkbox field. The screenshot I sent is a little bit small I suppose.

Gustavo Félix
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 22, 2020

Sorry, I didnt see It.

You can try cfValues['Field name'][0] == 'SomeValue' or cfValues['Field name']?.value == "Some value"

Let me know if this helps you.

Suggest an answer

Log in or Sign up to answer