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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Fadoua M. Boualem
Published yesterday in Trello

Using Trello to manage events

As a Jira power user, I was at first doubtful that Trello could benefit my workflow. Jira already uses boards (ones you can customize!), so why would I even need to use Trello?! In this post you will...

451 views 6 7
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