Description: Updates a Watch.
Notes: This will overwrite the previous Watch configurations and replace them with the updated parameters. You cannot update the project_key property. A Watch can include both Global and Project Policies.
Security: Requires the "Manage Watches" role to be set on the User or Group level.
Usage: PUT /xray/api/v2/watches/{name}
Consumes: application/json
Produces: application/json
Path Parameters:
Name | Type | Required/Optional | Description |
---|---|---|---|
name | string | required | Name of the watch to be updated |
Query Parameters:
Name | Type | Required/Optional | Description |
---|---|---|---|
| string | optional | Project key for scoped updates |
Request Body:
Name | Type | Required/Optional | Description |
---|---|---|---|
| required | General data for the Watch | |
| optional | Resources the watch is applied on. It may be omitted only if | |
| array[string] | optional | Email addresses to receive Watch notifications |
| array[AssignedPolicyObj] | optional | Policies assigned to the Watch |
| boolean | optional | Indicates whether Jira ticket creation is enabled |
| string | optional | Jira profile for ticket generation |
| optional | Ticket generation settings for the Watch |
GeneralDataObj:
Name | Type | Required/Optional | Description |
---|---|---|---|
| string | required | Name of the Watch |
| string | optional | Description of the Watch |
| boolean | optional | Indicates if the Watch is active or not. Default:
|
ProjectResourcesObj:
Name | Type | Required/Optional | Description |
---|---|---|---|
| array[ResourceObj] | required | Resources to watch and associated Policies |
ResourceObj:
Name | Type | Required/Optional | Description |
---|---|---|---|
| string | required | Type of the resource. Valid values: |
| string | optional | Type of repository. Valid values: |
| string | optional | Binary manager ID. Omit or set to default. |
| string | required | Name of the resource |
| array[FilterObj] | optional | Filters to apply to the resource. |
FilterObj:
Name | Type | Required/Optional | Description |
---|---|---|---|
| string | required | Type of the filter. The acceptable filter type depends on the resource type. For the resource types repository and all-repos:
For the resource types all-builds,
For the resource types
|
| varies | required | Value of the filter, whose type depends on the filter type. |
For | |||
PatternObj | required | arrays of ant-style include and exclude path patterns. | |
For | |||
string | required | A regular expression string. | |
For | |||
string | required | One of the following package types: | |
For | |||
string | required | A MIME-type string. | |
For | |||
KeyValueObj | required | A custom property's key-value pair. |
PatternObj:
Name | Type | Required/Optional | Description |
---|---|---|---|
| array[string] | optional | arrays of ant-style include path patterns. |
| array[string] | optional | arrays of ant-style exclude path patterns. |
KeyValueObj:
Name | Type | Required/Optional | Description |
---|---|---|---|
| string | required | The key name of a custom property's key-value pair. |
| string | required | The value of a custom property's key-value pair. |
AssignedPolicyObj:
Name | Type | Required/Optional | Description |
---|---|---|---|
| string | required | Name of the policy |
| string | required | Type of the policy (e.g., security, license) Acceptable values: security, license, operational_risk |
TicketGenerationObj:
Name | Type | Required/Optional | Description |
---|---|---|---|
| optional | Settings for creating duplicate tickets | |
| array[ImpactPathProfileMappingObj] | optional | Mapping of impact path profiles |
DuplicateTicketCreationObj:
Name | Type | Required/Optional | Description |
---|---|---|---|
| optional | Settings for creating duplicate tickets by version |
VersionTicketSettingsObj:
Name | Type | Required/Optional | Description |
---|---|---|---|
| boolean | optional | Indicates whether duplicate tickets are created for builds |
| boolean | optional | Indicates whether duplicate tickets are created for packages |
| boolean | optional | Indicates whether duplicate tickets are created for release bundles |
ImpactPathProfileMappingObj:
Name | Type | Required/Optional | Description |
---|---|---|---|
| array[IncludeObj] | optional | Settings for mapping impact paths to JIRA profiles |
IncludeObj:
Name | Type | Required/Optional | Description |
---|---|---|---|
| string | required | Impact path profile |
| string | required | Pattern for the impact path corresponding to profile |
Response Body
Name | Type | Description |
---|---|---|
| string | Success info message |
| string | Error message text |
Response Codes
Status code | Description |
---|---|
200 | Success. Watch was successfully updated |
400 | Failed to update watch: Watch name is empty |
403 | Failed to update watch: no permissions |
404 | Failed to update the watch. Watch not found |
415 | Failed to parse request |
500 | Failed to update watch |
500 | Failed to reload block download cache |
Example Request
{ "general_data": { "description": "This is a new watch created using API V2", "active": true }, "project_resources": { "resources": [ { "type": "all-repos", "filters": [ { "type": "package-type", "value": "Docker" }, { "type": "package-type", "value": "Debian" } ] } ] }, "assigned_policies": [ { "name": "critial_issues", "type": "security" } ], "create_ticket_enabled":true, "ticket_profile":"test", "watch_recipients":["mymail@acme.com","umac@youremail.com"] }
Update Watch in Project scope
PUT /xray/api/v2/watches/proj-wath?projectKey=<project_key>