The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create a task when closing story based on a resolution validation

Shawn Danisa
November 16, 2017

Helo,

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Alexey Matveev
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 Champions.
November 16, 2017

Hello,

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