Automatically create a new epic when the tea option is checked on Story creation

Shawn Danisa March 20, 2018

I would like to automatically create a new epic when the user chose the tea option on the favourite drink checkbox located on the screen of the story issuetype.  The multiselect checkbox contains the options: tea, coffee, water.

I am using scriptrunner.  So far I went to the clone issue option on scriptrunner. and added the following condition to test the checkbox: 

cfValues['customfield_11802'] == 'Tea' 

I would also like to copy the summary field to the new epic.. But I also know that the epic name is a compulsory field... and I am not sure how to copy the summary to the epic summary field

The problem so far is that the a new story didn't get created.  I think the condition is failing

1 answer

0 votes
Daniel Yelamos [Adaptavist]
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.
March 20, 2018

Hi!

We'd like to give you a hand fixing it. But it isn't much info to be honest.

To know if your function is running or not, you can check the information of the script, there should be a "Run x times" dialog somewhere in your version. 

We need an screenshot of your configuration.

To do this properly you will need:

1. A post-function or listener of type Clone-issue or similar. 

2. The condition looks fine to me, but if I'm not mistaken, cfValues saves as a key the name of the field, not the id. You can see examples of this here.

3. Select Summary as field to copy.

4. Select issue type that you want. 

I'm feeling a bit confused though, you say that you want to create an epic, and then a story. 

Get back to your configuration, get me a screenshot and we'll get that fixed right away sir!

Regards!
DYelamos

Shawn Danisa March 20, 2018

Usually, One would create the Epic first, then create the story and use the Epic link field to link the two issues, but in this instance, the client would like to create a Story first, then automatically create an epic.  I am also not sure how I would go about populating the Epic Name with the Summary of the story. Thank you SirPic 1.JPGpic 2.JPG

Suggest an answer

Log in or Sign up to answer