This is an automated email from the ASF dual-hosted git repository.

lynwee pushed a commit to branch dev-1
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/dev-1 by this push:
     new eaf972a97 feat(webhook): calculate `LeadTimeMinutes` if necessary
eaf972a97 is described below

commit eaf972a97eec1a0efc69a15ff8cdd33efa9d4c15
Author: d4x1 <[email protected]>
AuthorDate: Thu Aug 1 13:38:39 2024 +0800

    feat(webhook): calculate `LeadTimeMinutes` if necessary
---
 backend/plugins/webhook/api/issues.go | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/backend/plugins/webhook/api/issues.go 
b/backend/plugins/webhook/api/issues.go
index 7ee19e062..d419e17ff 100644
--- a/backend/plugins/webhook/api/issues.go
+++ b/backend/plugins/webhook/api/issues.go
@@ -138,6 +138,19 @@ 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
+               }
+       }
+       if *domainIssue.TimeRemainingMinutes == 0 {
+               // FIXME we have no idea about how to calculate it.
+       }
+       if *domainIssue.TimeSpentMinutes == 0 {
+               // FIXME we have no idea about how to calculate it.
+       }
+
        if request.CreatorId != "" {
                domainIssue.CreatorId = fmt.Sprintf("%s:%d:%s", "webhook", 
connection.ID, request.CreatorId)
        }

Reply via email to