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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

696 views 3 11
Read article

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