How to use groovy scripts to clone an issue based on multiple project select choose

Hi Support,

How to use groovy scripts to clone an issue based on multiple project select choose?

I am a begineer for groovy scripts and not familiar with it?

Could you please give me some direction or suggestions?

Or Provides some reference code?

Thank you.

2 answers

Hi Yun,

Could you provide more details as to what you are trying to accomplish?

Let me see if I understand correctly:

  1. You have a custom field of type "Multi-select" list
  2. Users can select types of "Projects" from the Multi-select list
  3. If they select certain projects, you want to clone the issue 

You could accomplish this using a Script post-function. For example, you could add a post-function on the "Create" transition of the workflow.

ScriptRunner already has a built-in function to clone an issue:

Screen Shot 2017-09-11 at 3.21.42 PM.png

You could use a condition like this to check what values are selected in the custom field:

('Project1' in cfValues['Project List']*.value) && ('Project2' in cfValues['Project List']*.value) && ('Project3' in cfValues['Project List']*.value) 

 

Hi Support,

This Clones an issue,and links function only support traget single project created,But I want to choose multiple project to create,do you have any suggestions about it?

Hi Support,

This Clones an issue,and links function only support traget single project created,But I want to choose multiple project to create,do you have any suggestions about it?

 

Thank You.

Suggest an answer

Log in or Sign up to answer
Community showcase
Asked Dec 06, 2018 in Jira Ops

I'm John Allspaw, Ask Me Anything about incident analysis and postmortems

I'm John Allspaw, co-founder of   Adaptive Capacity Labs, where we help teams use their incidents to learn and improve. We bring research-driven methods and approaches to drive effective inciden...

5,535 views 21 17
View question

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