Skip to content

Commit

Permalink
Added ticket status in widget display
Browse files Browse the repository at this point in the history
  • Loading branch information
jdenoy committed Feb 5, 2019
1 parent 4dcaa15 commit 96bef17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions jira/issues.go
Expand Up @@ -13,6 +13,7 @@ type IssueFields struct {
Summary string `json:"summary"`

IssueType *IssueType `json:"issuetype"`
IssueStatus *IssueStatus `json:"status"`
}

type IssueType struct {
Expand All @@ -23,3 +24,9 @@ type IssueType struct {
Name string `json:"name"`
Subtask bool `json:"subtask"`
}

type IssueStatus struct {
ISelf string `json:"self"`
IDescription string `json:"description"`
IName string `json:"name"`
}
3 changes: 2 additions & 1 deletion jira/widget.go
Expand Up @@ -113,12 +113,13 @@ func (widget *Widget) contentFrom(searchResult *SearchResult) string {

for idx, issue := range searchResult.Issues {
fmtStr := fmt.Sprintf(
`["%d"][""][%s] [%s]%-6s[white] [green]%-10s[white] [%s]%s`,
`["%d"][""][%s] [%s]%-6s[white] [green]%-10s[white] [yellow][%s][white] [%s]%s`,
idx,
widget.rowColor(idx),
widget.issueTypeColor(&issue),
issue.IssueFields.IssueType.Name,
issue.Key,
issue.IssueFields.IssueStatus.IName,
widget.rowColor(idx),
issue.IssueFields.Summary,
)
Expand Down

0 comments on commit 96bef17

Please sign in to comment.