Search code examples
workflowjiraparentjql

How a Subtask can Create a Subtask


I know how to automatically create subtasks when the Parent Status changes, But how do I automatically create subtasks when another subtask closes (Without changing the parent status)?


Solution

  • You may want to create a custom listener using Script Runner. The code can be something like that:

    class ExampleListener extends AbstractIssueEventListener {
        Category log = Category.getInstance(ExampleListener.class)
    
        @Override
        void workflowEvent(IssueEvent event) {
            log.debug "Event: ${event.getEventTypeId()} fired for ${event.issue} and caught by ExampleListener"
        }
    }
    

    You can find that section on the administration area, it is called "Script Listeners". In this way you can catch the event and do what you need after some checks (is a subtask, status ....). You can retrieve everything you need from the event object.

    https://jamieechlin.atlassian.net/wiki/display/GRV/Listeners