diff --git a/xray/services/report.go b/xray/services/report.go index ee387f8ed..685a37efe 100644 --- a/xray/services/report.go +++ b/xray/services/report.go @@ -3,11 +3,12 @@ package services import ( "encoding/json" "fmt" + "net/http" + "github.com/jfrog/jfrog-client-go/artifactory/services/utils" "github.com/jfrog/jfrog-client-go/auth" "github.com/jfrog/jfrog-client-go/http/jfroghttpclient" "github.com/jfrog/jfrog-client-go/utils/errorutils" - "net/http" ) const ( @@ -76,7 +77,7 @@ type Row struct { ExternalAdvisorySource string `json:"external_advisory_source,omitempty"` ExternalAdvisorySeverity string `json:"external_advisory_severity,omitempty"` // Licenses Report field - License string `json:"license,omitempty"` + License string `json:"license_key,omitempty"` LicenseName string `json:"license_name,omitempty"` Component string `json:"component,omitempty"` Artifact string `json:"artifact,omitempty"` diff --git a/xray/services/utils/watchbody.go b/xray/services/utils/watchbody.go index aee708ff3..2a68a3762 100644 --- a/xray/services/utils/watchbody.go +++ b/xray/services/utils/watchbody.go @@ -47,7 +47,8 @@ func NewWatchParams() WatchParams { Builds: WatchBuildsParams{ ByNames: make(map[string]WatchBuildsByNameParams, 0), }, - Policies: make([]AssignedPolicy, 0), + Policies: make([]AssignedPolicy, 0), + WatchRecipients: make([]string, 0), } } @@ -61,6 +62,8 @@ type WatchParams struct { Builds WatchBuildsParams Policies []AssignedPolicy + + WatchRecipients []string } // WatchRepositoriesParams is a struct that stores the repository configuration for watch @@ -120,6 +123,7 @@ type WatchBody struct { GeneralData watchGeneralParams `json:"general_data"` ProjectResources watchProjectResources `json:"project_resources,omitempty"` AssignedPolicies []AssignedPolicy `json:"assigned_policies,omitempty"` + WatchRecipients []string `json:"watch_recipients"` } // These structs are internal @@ -175,6 +179,7 @@ func CreateBody(params WatchParams) (*WatchBody, error) { Resources: []watchProjectResourcesElement{}, }, AssignedPolicies: params.Policies, + WatchRecipients: params.WatchRecipients, } err := configureRepositories(&payloadBody, params) diff --git a/xray/services/watch.go b/xray/services/watch.go index ae356e0b7..09274ba9d 100644 --- a/xray/services/watch.go +++ b/xray/services/watch.go @@ -182,6 +182,7 @@ func (xws *WatchService) Get(watchName string) (watchResp *utils.WatchParams, er ByNames: map[string]utils.WatchBuildsByNameParams{}, } result.Policies = watch.AssignedPolicies + result.WatchRecipients = watch.WatchRecipients utils.UnpackWatchBody(&result, &watch)