Skip to content

Commit

Permalink
feat(webhook): calculate LeadTimeMinutes if necessary (#7814)
Browse files Browse the repository at this point in the history
* feat(webhook): calculate `LeadTimeMinutes` if necessary

* fix(webhook): disable SA9003

* fix(webhook): fix lint errors
  • Loading branch information
d4x1 authored and action_bot committed Aug 1, 2024
1 parent 11be777 commit 42b0ac2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backend/plugins/webhook/api/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ func PostIssue(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, error
Severity: request.Severity,
Component: request.Component,
}
if *domainIssue.LeadTimeMinutes == 0 {
if domainIssue.ResolutionDate != nil && domainIssue.CreatedDate != nil {
temp := uint(domainIssue.ResolutionDate.Sub(*domainIssue.CreatedDate).Minutes())
domainIssue.LeadTimeMinutes = &temp
}
}
// FIXME we have no idea about how to calculate domainIssue.TimeRemainingMinutes and domainIssue.TimeSpentMinutes.
if request.CreatorId != "" {
domainIssue.CreatorId = fmt.Sprintf("%s:%d:%s", "webhook", connection.ID, request.CreatorId)
}
Expand Down

0 comments on commit 42b0ac2

Please sign in to comment.