From e5ed57c3d8ff55a61fde135927b9170ad1545ea3 Mon Sep 17 00:00:00 2001 From: Miguel de la Cruz Date: Thu, 5 Mar 2020 22:42:49 +0100 Subject: [PATCH] Add publish batch command --- jira/jira.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jira/jira.go b/jira/jira.go index 884e956..a03685f 100644 --- a/jira/jira.go +++ b/jira/jira.go @@ -143,5 +143,14 @@ func (c *JiraClient) PublishAll(cmp *model.Campaign) (int, error) { } func (c *JiraClient) PublishBatch(cmp *model.Campaign, batch int) error { + for i := 0; i <= batch; i++ { + next, err := c.PublishNextTicket(cmp) + if err != nil { + return err + } + if !next { + return nil + } + } return nil }