Commit Diff


commit - c3f6de414aa7ec58d1c876f8545c060940bbf65d
commit + a49ed26aed68f00abaf9d48e1ba9c25fa5a311d1
blob - 3eecbeb0c6c3453c9913ab8c323ee8a3e6d4e38e
blob + b5fda3dfa1d1be4ae42a25f38af58a45577a7298
--- jira/jira.go
+++ jira/jira.go
@@ -22,6 +22,7 @@ type Issue struct {
 	Project     Project   `json:"project"`
 	Created     time.Time `json:"created,omitzero"`
 	Updated     time.Time `json:"updated,omitzero"`
+	Due time.Time `json:"duedate,omitzero"`
 	Type        struct {
 		Name string `json:"name"`
 	} `json:"issuetype"`
@@ -102,6 +103,7 @@ func (issue *Issue) UnmarshalJSON(b []byte) error {
 	iaux := &struct {
 		Created    string `json:"created"`
 		Updated    string `json:"updated"`
+		Due string `json:"duedate"`
 		Comment    map[string]json.RawMessage
 		IssueLinks []struct {
 			InwardIssue  *Issue
@@ -128,6 +130,12 @@ func (issue *Issue) UnmarshalJSON(b []byte) error {
 			return fmt.Errorf("updated time: %w", err)
 		}
 	}
+	if iaux.Due != "" {
+		issue.Due, err = time.Parse(timestamp, iaux.Due)
+		if err != nil {
+			return fmt.Errorf("due date: %w", err)
+		}
+	}
 	if bb, ok := iaux.Comment["comments"]; ok {
 		if err := json.Unmarshal(bb, &issue.Comments); err != nil {
 			return fmt.Errorf("unmarshal comments: %w", err)
blob - 65b1c6661d55328871224e5b858fc401e0e3f060
blob + 3b42ead8dca8507aabfe55d75d1b3080e0ffe910
--- jira/print.go
+++ jira/print.go
@@ -23,6 +23,9 @@ func printIssue(i *Issue) string {
 		fmt.Fprintln(buf, "From:", i.Reporter)
 	}
 	fmt.Fprintln(buf, "Date:", i.Created.Format(time.RFC1123Z))
+	if !i.Due.IsZero() {
+		fmt.Fprintln(buf, "Due:", i.Due.Format(time.RFC1123Z))
+	}
 	if i.Assignee != nil {
 		fmt.Fprintln(buf, "Assignee:", i.Assignee)
 	}