Skip to content

Commit 72f4651

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add new DeleteAssignee endpoint to Error Tracking APIs (#2886)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent e473d29 commit 72f4651

9 files changed

+169
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61011,6 +61011,35 @@ paths:
6101161011
tags:
6101261012
- Error Tracking
6101361013
/api/v2/error-tracking/issues/{issue_id}/assignee:
61014+
delete:
61015+
description: Remove the assignee of an issue by `issue_id`.
61016+
operationId: DeleteIssueAssignee
61017+
parameters:
61018+
- $ref: '#/components/parameters/IssueIDPathParameter'
61019+
responses:
61020+
'204':
61021+
description: No Content
61022+
'400':
61023+
$ref: '#/components/responses/BadRequestResponse'
61024+
'401':
61025+
$ref: '#/components/responses/UnauthorizedResponse'
61026+
'403':
61027+
$ref: '#/components/responses/ForbiddenResponse'
61028+
'404':
61029+
$ref: '#/components/responses/NotFoundResponse'
61030+
'429':
61031+
$ref: '#/components/responses/TooManyRequestsResponse'
61032+
security:
61033+
- apiKeyAuth: []
61034+
appKeyAuth: []
61035+
- AuthZ:
61036+
- error_tracking_read
61037+
- error_tracking_write
61038+
- cases_read
61039+
- cases_write
61040+
summary: Remove the assignee of an issue
61041+
tags:
61042+
- Error Tracking
6101461043
put:
6101561044
description: Update the assignee of an issue by `issue_id`.
6101661045
operationId: UpdateIssueAssignee
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
Remove the assignee of an issue returns "No Content" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.error_tracking_api import ErrorTrackingApi
8+
9+
# there is a valid "issue" in the system
10+
ISSUE_ID = environ["ISSUE_ID"]
11+
12+
configuration = Configuration()
13+
with ApiClient(configuration) as api_client:
14+
api_instance = ErrorTrackingApi(api_client)
15+
api_instance.delete_issue_assignee(
16+
issue_id=ISSUE_ID,
17+
)

src/datadog_api_client/v2/api/error_tracking_api.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,29 @@ def __init__(self, api_client=None):
3030
api_client = ApiClient(Configuration())
3131
self.api_client = api_client
3232

33+
self._delete_issue_assignee_endpoint = _Endpoint(
34+
settings={
35+
"response_type": None,
36+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
37+
"endpoint_path": "/api/v2/error-tracking/issues/{issue_id}/assignee",
38+
"operation_id": "delete_issue_assignee",
39+
"http_method": "DELETE",
40+
"version": "v2",
41+
},
42+
params_map={
43+
"issue_id": {
44+
"required": True,
45+
"openapi_types": (str,),
46+
"attribute": "issue_id",
47+
"location": "path",
48+
},
49+
},
50+
headers_map={
51+
"accept": ["*/*"],
52+
},
53+
api_client=api_client,
54+
)
55+
3356
self._get_issue_endpoint = _Endpoint(
3457
settings={
3558
"response_type": (IssueResponse,),
@@ -137,6 +160,23 @@ def __init__(self, api_client=None):
137160
api_client=api_client,
138161
)
139162

163+
def delete_issue_assignee(
164+
self,
165+
issue_id: str,
166+
) -> None:
167+
"""Remove the assignee of an issue.
168+
169+
Remove the assignee of an issue by ``issue_id``.
170+
171+
:param issue_id: The identifier of the issue.
172+
:type issue_id: str
173+
:rtype: None
174+
"""
175+
kwargs: Dict[str, Any] = {}
176+
kwargs["issue_id"] = issue_id
177+
178+
return self._delete_issue_assignee_endpoint.call_with_http_info(**kwargs)
179+
140180
def get_issue(
141181
self,
142182
issue_id: str,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-10-17T14:43:40.022Z
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
interactions:
2+
- request:
3+
body: '{"data":{"attributes":{"from":1759416220000,"query":"service:synthetics-browser","to":1760712220000,"track":"rum"},"type":"search_request"}}'
4+
headers:
5+
accept:
6+
- application/json
7+
content-type:
8+
- application/json
9+
method: POST
10+
uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search
11+
response:
12+
body:
13+
string: '{"data":[{"id":"d3ab59c6-84ee-11f0-87bb-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":4316,"total_count":8640},"relationships":{"issue":{"data":{"id":"d3ab59c6-84ee-11f0-87bb-da7ad0900002","type":"issue"}}}},{"id":"a5bb2896-a4d0-11f0-bd76-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":280,"total_count":272},"relationships":{"issue":{"data":{"id":"a5bb2896-a4d0-11f0-bd76-da7ad0900002","type":"issue"}}}},{"id":"e2a89d14-6f07-11f0-8a88-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":4},"relationships":{"issue":{"data":{"id":"e2a89d14-6f07-11f0-8a88-da7ad0900002","type":"issue"}}}},{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":1},"relationships":{"issue":{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue"}}}},{"id":"e2a89134-6f07-11f0-8d36-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":1},"relationships":{"issue":{"data":{"id":"e2a89134-6f07-11f0-8d36-da7ad0900002","type":"issue"}}}}]}'
14+
headers:
15+
content-type:
16+
- application/vnd.api+json
17+
status:
18+
code: 200
19+
message: OK
20+
- request:
21+
body: null
22+
headers:
23+
accept:
24+
- '*/*'
25+
method: DELETE
26+
uri: https://api.datadoghq.com/api/v2/error-tracking/issues/d3ab59c6-84ee-11f0-87bb-da7ad0900002/assignee
27+
response:
28+
body:
29+
string: ''
30+
headers: {}
31+
status:
32+
code: 204
33+
message: No Content
34+
version: 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-10-17T14:43:41.755Z
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
accept:
6+
- '*/*'
7+
method: DELETE
8+
uri: https://api.datadoghq.com/api/v2/error-tracking/issues/67d80aa3-36ff-44b9-a694-c501a7591737/assignee
9+
response:
10+
body:
11+
string: '{"errors":[{"status":"404","title":"Not Found","detail":"issue not
12+
found"}]}'
13+
headers:
14+
content-type:
15+
- application/vnd.api+json
16+
status:
17+
code: 404
18+
message: Not Found
19+
version: 1

tests/v2/features/error_tracking.feature

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,28 @@ Feature: Error Tracking
3232
Then the response status is 200 OK
3333
And the response "data.id" is equal to "{{ issue.id }}"
3434

35+
@generated @skip @team:DataDog/error-tracking
36+
Scenario: Remove the assignee of an issue returns "Bad Request" response
37+
Given new "DeleteIssueAssignee" request
38+
And request contains "issue_id" parameter from "REPLACE.ME"
39+
When the request is sent
40+
Then the response status is 400 Bad Request
41+
42+
@team:DataDog/error-tracking
43+
Scenario: Remove the assignee of an issue returns "No Content" response
44+
Given new "DeleteIssueAssignee" request
45+
And there is a valid "issue" in the system
46+
And request contains "issue_id" parameter from "issue.id"
47+
When the request is sent
48+
Then the response status is 204 No Content
49+
50+
@team:DataDog/error-tracking
51+
Scenario: Remove the assignee of an issue returns "Not Found" response
52+
Given new "DeleteIssueAssignee" request
53+
And request contains "issue_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737"
54+
When the request is sent
55+
Then the response status is 404 Not Found
56+
3557
@team:DataDog/error-tracking
3658
Scenario: Search error tracking issues returns "Bad Request" response
3759
Given new "SearchIssues" request

tests/v2/features/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,12 @@
13191319
"type": "safe"
13201320
}
13211321
},
1322+
"DeleteIssueAssignee": {
1323+
"tag": "Error Tracking",
1324+
"undo": {
1325+
"type": "idempotent"
1326+
}
1327+
},
13221328
"UpdateIssueAssignee": {
13231329
"tag": "Error Tracking",
13241330
"undo": {

0 commit comments

Comments
 (0)