1
0
mirror of https://github.com/strongdm/comply synced 2024-11-05 07:25:26 +00:00

use Resolution field rather than Status

This commit is contained in:
Justin McCarthy 2018-06-01 17:18:41 -07:00
parent 25f7156ac2
commit f6c9f89792
No known key found for this signature in database
GPG Key ID: 900437410E142A48

View File

@ -179,7 +179,7 @@ func toTicket(i *jira.Issue) *model.Ticket {
t.Body = i.Fields.Summary
createdAt := time.Time(i.Fields.Created)
t.CreatedAt = &createdAt
t.State = toState(i.Fields.Status)
t.State = toState(i.Fields.Resolution)
for _, l := range i.Fields.Labels {
t.SetBool(l)
@ -187,9 +187,12 @@ func toTicket(i *jira.Issue) *model.Ticket {
return t
}
func toState(status *jira.Status) model.TicketState {
func toState(status *jira.Resolution) model.TicketState {
if status == nil {
return model.Open
}
switch status.Name {
case "Closed":
case "Done":
return model.Closed
}
return model.Open