Add campaigner list command
This commit is contained in:
parent
27965460d4
commit
0cff217a8b
4 changed files with 44 additions and 0 deletions
|
@ -2,6 +2,7 @@ package model
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
@ -87,6 +88,26 @@ func (c *Campaign) PrintStatus() {
|
|||
w.Flush()
|
||||
}
|
||||
|
||||
func (c *Campaign) PrintList() {
|
||||
for _, t := range c.Tickets {
|
||||
if t.IsPublishedJira() {
|
||||
var str string
|
||||
if t.IsPublishedGithub() {
|
||||
str = fmt.Sprintf("[%s / #%d] %s", t.JiraLink, t.GithubLink, t.Summary)
|
||||
} else {
|
||||
str = fmt.Sprintf("[%s] %s", t.JiraLink, t.Summary)
|
||||
}
|
||||
if t.GithubStatus != "" {
|
||||
str += fmt.Sprintf(" (%s)", t.GithubStatus)
|
||||
}
|
||||
fmt.Println(str)
|
||||
} else {
|
||||
b, _ := json.Marshal(t)
|
||||
fmt.Printf("unpublished: %s\n", string(b))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Campaign) AddTickets(tickets []*Ticket, fileOnly bool) {
|
||||
c.Tickets = append(c.Tickets, tickets...)
|
||||
c.RemoveDuplicateTickets(fileOnly)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue