Create a task when closing story based on a resolution validation


I the following task: Automatically create an issue of type "Task" when closing a story.  The task created must automatically be linked to the closing story.  In addition: This task must only be created when the resolution of the story is set to Done or Resolved.

So, on scriptRunner I went to the option to Clones an issue, and links, set the Target project, Target Issue Type and Issue type link.  With these steps I managed to successfully create the "Task" when the story closes, but I am struggling with the last part of the problem: "Task to be created only when the resolution is "Done" or "Resolved"

1 answer

1 accepted

0 vote
Alexey Matveev Community Champion Nov 16, 2017


When you created the post function, there is a condition field which you have to fill. If this condition returns true then the post function will fire, it false then the post function will not fire. 

You need to enter there the following line

issue.getResolution().getName() == "Done" || issue.getResolution().getName() == "Resolved"

This line will return true if resolution is Done or Resolved 

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...

165 views 1 10
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