mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-06 15:22:47 +01:00
Fix automated root task start (#541)
Co-authored-by: Jonas Plum <git@jonasplum.de>
This commit is contained in:
@@ -259,14 +259,13 @@ func findName(playbooks map[string]*model.PlaybookResponse, name string) string
|
||||
func runRootTask(ticket *model.TicketResponse, playbookID string, db *Database) error {
|
||||
playbook := ticket.Playbooks[playbookID]
|
||||
|
||||
var root *model.TaskResponse
|
||||
for _, task := range playbook.Tasks {
|
||||
if task.Order == 0 {
|
||||
root = task
|
||||
for id, task := range playbook.Tasks {
|
||||
if task.Order == 0 && task.Type == model.TaskTypeAutomation {
|
||||
if err := runTask(ticket.ID, playbookID, id, task, ticket, db); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
runNextTasks(ticket.ID, playbookID, root.Next, root.Data, ticket, db)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user