Scriptrunner post function: auto create Subtask and set status to Status of parent ticket

Rich Wolverton
Contributor
September 10, 2019

We have a long workflow that is creating subtasks at various transitions. We we like to have the subtask inherit the Status of the Parent task at the transition so that it will appear in the same column of on the Board. Seems like a simple action but Status is not on the list of Inheritable system fields.

Looking at adding a hard coded value but not getting the syntax correct.

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -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.
September 17, 2019

This would be quite a complex script.  Possible, but probably not fun to write.

Creating sub-tasks is not hard, and SR has a simple "create sub-task on transition" canned function in it already.

But, Jira sub-tasks are issues in their own right, and therefore have their own workflow, which may or may not be shared with their parent issue.   Workflows all use the "create" transition when they are created, so the sub-tasks you create will start there. 

To make them take the status of the parent, you'll need to create them all, then look at each one, and work out the path through the workflow to where they need to go, then transition them through the transition(s) needed to get there!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events