Automatically create a new Task when story is done script Runner

Hi All,

I have the following issue types:

  • Story
  • Task

The story and the Task have two different workflows.  When the story transitions to "Done" I would like the following to happen:

  • Automatically create an Issue of Type "Task"
  • Link the newly Created Issue type to the Story
  • Populate the summary of the new Task with the Story Issue ID

This is proving to be very challenging for me, please assist.  I am using script Runner

1 answer

1 accepted

1 vote
Mizan Community Champion Oct 19, 2017

Did you try the "Clone issue and link" post function by script runner ?

Hi Mizan,

I'm new to groovy and scriptrunner. I'm not sure how to do it

Mizan Community Champion Oct 19, 2017

On the "Done" transition of your Story workflow add a post function

select Script post function then Add

select Clone issues and links

select target issue type as Task

In additional actions enter the below code

issue.summary = sourceIssue.key+': ' + sourceIssue.summary

select issue type link direction as relates to (first one) (You can create your own link types as well)

Add then publish workflow

Test it out by transitioning "Done" of the story

Let me know how it goes 

You are the greatest :)

Mizan Community Champion Oct 19, 2017

Happy to help :) thank you

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,281 views 14 20
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot