diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 85a6c58a698..ff41ab4b018 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -13426,7 +13426,8 @@ components: description: Attributes of the Jira issue to create. properties: assignee_id: - description: Unique identifier of the user assigned to the Jira issue. + description: Unique identifier of the Datadog user assigned to the Jira + issue. example: f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0 type: string description: @@ -13447,8 +13448,9 @@ components: type: object priority: $ref: '#/components/schemas/CasePriority' - description: Priority of the Jira issue. If not provided, the priority will - be automatically set to "NOT_DEFINED". + description: Datadog case priority mapped to the Jira issue priority. If + not provided, the priority will be automatically set to "NOT_DEFINED". + To configure the mapping, see [Bidirectional ticket syncing with Jira](https://docs.datadoghq.com/security/ticketing_integrations/#bidirectional-ticket-syncing-with-jira). example: P4 title: description: Title of the Jira issue. If not provided, the title will be @@ -84711,9 +84713,6 @@ paths: permissions: - security_monitoring_findings_write - appsec_vm_write - x-unstable: '**Note**: This endpoint is in beta and is subject to change. - - Please check the documentation regularly for updates.' post: description: 'Create Jira issues for security findings. @@ -84757,9 +84756,6 @@ paths: permissions: - security_monitoring_findings_write - appsec_vm_write - x-unstable: '**Note**: This endpoint is in beta and is subject to change. - - Please check the documentation regularly for updates.' /api/v2/security/findings/search: post: description: 'Get a list of security findings that match a search query. [See diff --git a/examples/v2/security-monitoring/CreateJiraIssues.java b/examples/v2/security-monitoring/CreateJiraIssues.java index c01e95d5188..a7057b855dd 100644 --- a/examples/v2/security-monitoring/CreateJiraIssues.java +++ b/examples/v2/security-monitoring/CreateJiraIssues.java @@ -6,7 +6,6 @@ import com.datadog.api.client.v2.model.CaseManagementProject; import com.datadog.api.client.v2.model.CaseManagementProjectData; import com.datadog.api.client.v2.model.CaseManagementProjectDataType; -import com.datadog.api.client.v2.model.CasePriority; import com.datadog.api.client.v2.model.CreateJiraIssueRequestArray; import com.datadog.api.client.v2.model.CreateJiraIssueRequestData; import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataAttributes; @@ -16,31 +15,23 @@ import com.datadog.api.client.v2.model.FindingDataType; import com.datadog.api.client.v2.model.Findings; import com.datadog.api.client.v2.model.JiraIssuesDataType; +import java.util.Arrays; import java.util.Collections; -import java.util.Map; public class Example { public static void main(String[] args) { ApiClient defaultClient = ApiClient.getDefaultApiClient(); - defaultClient.setUnstableOperationEnabled("v2.createJiraIssues", true); SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); CreateJiraIssueRequestArray body = new CreateJiraIssueRequestArray() .data( - Collections.singletonList( + Arrays.asList( new CreateJiraIssueRequestData() .attributes( new CreateJiraIssueRequestDataAttributes() - .assigneeId("f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0") - .description("A description of the Jira issue.") - .fields( - Map.ofEntries( - Map.entry("key1", "value"), - Map.entry("key2", "['value']"), - Map.entry("key3", "{'key4': 'value'}"))) - .priority(CasePriority.NOT_DEFINED) - .title("A title for the Jira issue.")) + .title("A title") + .description("A description")) .relationships( new CreateJiraIssueRequestDataRelationships() .findings( @@ -49,13 +40,35 @@ public static void main(String[] args) { Collections.singletonList( new FindingData() .id( - "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==") + "eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==") .type(FindingDataType.FINDINGS)))) .project( new CaseManagementProject() .data( new CaseManagementProjectData() - .id("aeadc05e-98a8-11ec-ac2c-da7ad0900001") + .id("959a6f71-bac8-4027-b1d3-2264f569296f") + .type(CaseManagementProjectDataType.PROJECTS)))) + .type(JiraIssuesDataType.JIRA_ISSUES), + new CreateJiraIssueRequestData() + .attributes( + new CreateJiraIssueRequestDataAttributes() + .title("A title") + .description("A description")) + .relationships( + new CreateJiraIssueRequestDataRelationships() + .findings( + new Findings() + .data( + Collections.singletonList( + new FindingData() + .id( + "a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==") + .type(FindingDataType.FINDINGS)))) + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .id("959a6f71-bac8-4027-b1d3-2264f569296f") .type(CaseManagementProjectDataType.PROJECTS)))) .type(JiraIssuesDataType.JIRA_ISSUES))); diff --git a/examples/v2/security-monitoring/CreateJiraIssues_379590688.java b/examples/v2/security-monitoring/CreateJiraIssues_379590688.java new file mode 100644 index 00000000000..9bbbe379293 --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues_379590688.java @@ -0,0 +1,63 @@ +// Create Jira issue for security finding returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.CaseManagementProject; +import com.datadog.api.client.v2.model.CaseManagementProjectData; +import com.datadog.api.client.v2.model.CaseManagementProjectDataType; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestArray; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestData; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationships; +import com.datadog.api.client.v2.model.FindingCaseResponseArray; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import com.datadog.api.client.v2.model.JiraIssuesDataType; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + CreateJiraIssueRequestArray body = + new CreateJiraIssueRequestArray() + .data( + Collections.singletonList( + new CreateJiraIssueRequestData() + .attributes( + new CreateJiraIssueRequestDataAttributes() + .title("A title") + .description("A description")) + .relationships( + new CreateJiraIssueRequestDataRelationships() + .findings( + new Findings() + .data( + Collections.singletonList( + new FindingData() + .id( + "YmNlZmJhYTcyMDU5ZDk0ZDhiNjRmNGI0NDk4MDdiNzN-MDJlMjg0NzNmYzJiODY2MzJkNjU0OTI4NmVhZTUyY2U=") + .type(FindingDataType.FINDINGS)))) + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .id("959a6f71-bac8-4027-b1d3-2264f569296f") + .type(CaseManagementProjectDataType.PROJECTS)))) + .type(JiraIssuesDataType.JIRA_ISSUES))); + + try { + FindingCaseResponseArray result = apiInstance.createJiraIssues(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#createJiraIssues"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/CreateJiraIssues_829823123.java b/examples/v2/security-monitoring/CreateJiraIssues_829823123.java new file mode 100644 index 00000000000..92150626e45 --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues_829823123.java @@ -0,0 +1,68 @@ +// Create Jira issue for security findings returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.CaseManagementProject; +import com.datadog.api.client.v2.model.CaseManagementProjectData; +import com.datadog.api.client.v2.model.CaseManagementProjectDataType; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestArray; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestData; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationships; +import com.datadog.api.client.v2.model.FindingCaseResponseArray; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import com.datadog.api.client.v2.model.JiraIssuesDataType; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + CreateJiraIssueRequestArray body = + new CreateJiraIssueRequestArray() + .data( + Collections.singletonList( + new CreateJiraIssueRequestData() + .attributes( + new CreateJiraIssueRequestDataAttributes() + .title("A title") + .description("A description")) + .relationships( + new CreateJiraIssueRequestDataRelationships() + .findings( + new Findings() + .data( + Arrays.asList( + new FindingData() + .id( + "a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==") + .type(FindingDataType.FINDINGS), + new FindingData() + .id( + "eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==") + .type(FindingDataType.FINDINGS)))) + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .id("959a6f71-bac8-4027-b1d3-2264f569296f") + .type(CaseManagementProjectDataType.PROJECTS)))) + .type(JiraIssuesDataType.JIRA_ISSUES))); + + try { + FindingCaseResponseArray result = apiInstance.createJiraIssues(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#createJiraIssues"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index e2c4bb2bac2..152e0829d88 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -775,10 +775,8 @@ public class ApiClient { put("v2.getOpenAPI", false); put("v2.listAPIs", false); put("v2.updateOpenAPI", false); - put("v2.attachJiraIssue", false); put("v2.cancelThreatHuntingJob", false); put("v2.convertJobResultToSignal", false); - put("v2.createJiraIssues", false); put("v2.deleteThreatHuntingJob", false); put("v2.getFinding", false); put("v2.getRuleVersionHistory", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java index 1da16233289..837c5c46659 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java @@ -344,13 +344,6 @@ public CompletableFuture attachJiraIssueAsync(AttachJiraIss */ public ApiResponse attachJiraIssueWithHttpInfo(AttachJiraIssueRequest body) throws ApiException { - // Check if unstable operation is enabled - String operationId = "attachJiraIssue"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } Object localVarPostBody = body; // verify the required parameter 'body' is set @@ -393,16 +386,6 @@ public ApiResponse attachJiraIssueWithHttpInfo(AttachJiraIs */ public CompletableFuture> attachJiraIssueWithHttpInfoAsync( AttachJiraIssueRequest body) { - // Check if unstable operation is enabled - String operationId = "attachJiraIssue"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } Object localVarPostBody = body; // verify the required parameter 'body' is set @@ -1372,13 +1355,6 @@ public CompletableFuture createJiraIssuesAsync( */ public ApiResponse createJiraIssuesWithHttpInfo( CreateJiraIssueRequestArray body) throws ApiException { - // Check if unstable operation is enabled - String operationId = "createJiraIssues"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } Object localVarPostBody = body; // verify the required parameter 'body' is set @@ -1421,16 +1397,6 @@ public ApiResponse createJiraIssuesWithHttpInfo( */ public CompletableFuture> createJiraIssuesWithHttpInfoAsync( CreateJiraIssueRequestArray body) { - // Check if unstable operation is enabled - String operationId = "createJiraIssues"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } Object localVarPostBody = body; // verify the required parameter 'body' is set diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributes.java index ffe6da3985b..f35ead4fb16 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributes.java @@ -49,7 +49,7 @@ public CreateJiraIssueRequestDataAttributes assigneeId(String assigneeId) { } /** - * Unique identifier of the user assigned to the Jira issue. + * Unique identifier of the Datadog user assigned to the Jira issue. * * @return assigneeId */ diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.freeze new file mode 100644 index 00000000000..a96661d790d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.freeze @@ -0,0 +1 @@ +2026-01-02T17:04:07.979Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.json new file mode 100644 index 00000000000..29aded9bb1c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.json @@ -0,0 +1,57 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":[{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"relationships\":{\"findings\":{\"data\":[{\"id\":\"YmNlZmJhYTcyMDU5ZDk0ZDhiNjRmNGI0NDk4MDdiNzN-MDJlMjg0NzNmYzJiODY2MzJkNjU0OTI4NmVhZTUyY2U=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"jira_issues\"}]}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/jira_issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"b5b9ee39-29f8-4b84-a878-28e597e2a33f\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2026-01-02T17:04:10.514692Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/csm/vm?query=%40workflow.integrations.cases.id%3A%2A\\u0026vulnerability=bcefbaa72059d94d8b64f4b449807b73\",\"resource_id\":\"YmNlZmJhYTcyMDU5ZDk0ZDhiNjRmNGI0NDk4MDdiNzN-MDJlMjg0NzNmYzJiODY2MzJkNjU0OTI4NmVhZTUyY2U=\"}],\"jira_issue\":{\"status\":\"COMPLETED\",\"result\":{\"issue_id\":\"2523546\",\"issue_key\":\"CSMSEC-105847\",\"issue_url\":\"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105847\",\"account_id\":\"fdcffa62-24ab-4914-a195-a22bdc607030\"}},\"key\":\"CSMINV-521\",\"modified_at\":\"2026-01-02T17:04:11.504549Z\",\"priority\":\"P4\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "66c50173-25aa-e544-7ddd-43626af2401e" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"findings\":{\"data\":[{\"id\":\"YmNlZmJhYTcyMDU5ZDk0ZDhiNjRmNGI0NDk4MDdiNzN-MDJlMjg0NzNmYzJiODY2MzJkNjU0OTI4NmVhZTUyY2U=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8212e835-e925-377e-3a73-db3447b49755" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.freeze new file mode 100644 index 00000000000..536270faa5a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.freeze @@ -0,0 +1 @@ +2026-01-02T17:21:33.080Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.json new file mode 100644 index 00000000000..8f62504ba31 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.json @@ -0,0 +1,57 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":[{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"relationships\":{\"findings\":{\"data\":[{\"id\":\"a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==\",\"type\":\"findings\"},{\"id\":\"eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"jira_issues\"}]}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/jira_issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"527aa591-d40e-4445-be80-9d012ba8397e\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2026-01-02T17:21:34.65318Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/compliance?panels=cpfinding%7Cevent%7CruleId%3Akvh-scm-xyu%7CresourceId%3Ai-05f90f00a848687e8\\u0026query=%40finding_id%3Aa3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA%3D%3D\",\"resource_id\":\"a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==\"},{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/compliance?panels=cpfinding%7Cevent%7CruleId%3Ayk0-blt-afn%7CresourceId%3Ai-024ea8035de550b0a\\u0026query=%40finding_id%3AeWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ%3D%3D\",\"resource_id\":\"eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==\"}],\"jira_issue\":{\"status\":\"COMPLETED\",\"result\":{\"issue_id\":\"2523579\",\"issue_key\":\"CSMSEC-105849\",\"issue_url\":\"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105849\",\"account_id\":\"fdcffa62-24ab-4914-a195-a22bdc607030\"}},\"key\":\"CSMINV-523\",\"modified_at\":\"2026-01-02T17:21:35.836445Z\",\"priority\":\"P3\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1ce4a066-1777-4a13-107a-661ea467db71" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"findings\":{\"data\":[{\"id\":\"a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6572e0b0-c67d-c572-b4d9-4501093d4afa" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..6b40b01ad63 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2026-01-02T16:54:04.434Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.json new file mode 100644 index 00000000000..5451f2e7af2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":[{\"attributes\":{},\"relationships\":{\"findings\":{\"data\":[]},\"project\":{\"data\":{\"id\":\"7f198869-c7ef-4afc-97cf-da5cdc13b5c3\",\"type\":\"projects\"}}},\"type\":\"jira_issues\"}]}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/jira_issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"no finding provided\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b1ea1e59-1255-1888-ac07-e95b75f3804b" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.freeze new file mode 100644 index 00000000000..0a903f8222a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.freeze @@ -0,0 +1 @@ +2026-01-02T17:23:28.665Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.json new file mode 100644 index 00000000000..4525a67c2fe --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.json @@ -0,0 +1,57 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":[{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"relationships\":{\"findings\":{\"data\":[{\"id\":\"eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"jira_issues\"},{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"relationships\":{\"findings\":{\"data\":[{\"id\":\"a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"jira_issues\"}]}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/jira_issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"3f234879-c155-4104-8605-a956c6157fa2\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2026-01-02T17:23:30.862128Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/compliance?panels=cpfinding%7Cevent%7CruleId%3Ayk0-blt-afn%7CresourceId%3Ai-024ea8035de550b0a\\u0026query=%40finding_id%3AeWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ%3D%3D\",\"resource_id\":\"eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==\"}],\"jira_issue\":{\"status\":\"COMPLETED\",\"result\":{\"issue_id\":\"2523584\",\"issue_key\":\"CSMSEC-105851\",\"issue_url\":\"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105851\",\"account_id\":\"fdcffa62-24ab-4914-a195-a22bdc607030\"}},\"key\":\"CSMINV-524\",\"modified_at\":\"2026-01-02T17:23:32.188706Z\",\"priority\":\"P3\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}},{\"id\":\"55b8c3c1-7080-4e13-b5fc-6bb658609fb7\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2026-01-02T17:23:30.862076Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/compliance?panels=cpfinding%7Cevent%7CruleId%3Akvh-scm-xyu%7CresourceId%3Ai-05f90f00a848687e8\\u0026query=%40finding_id%3Aa3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA%3D%3D\",\"resource_id\":\"a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==\"}],\"jira_issue\":{\"status\":\"COMPLETED\",\"result\":{\"issue_id\":\"2523583\",\"issue_key\":\"CSMSEC-105850\",\"issue_url\":\"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105850\",\"account_id\":\"fdcffa62-24ab-4914-a195-a22bdc607030\"}},\"key\":\"CSMINV-525\",\"modified_at\":\"2026-01-02T17:23:31.898339Z\",\"priority\":\"P3\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "132caa04-d2db-3946-4db5-e58fdce2385c" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"findings\":{\"data\":[{\"id\":\"eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "29d85841-9a93-92de-28bd-034b4f599ce2" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..9fd2d2504eb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-01-02T16:58:53.646Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.json new file mode 100644 index 00000000000..7ae94838fa5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":[{\"attributes\":{},\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"00000000-0000-0000-0000-000000000000\",\"type\":\"projects\"}}},\"type\":\"jira_issues\"}]}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/jira_issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"finding not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5a0057c5-0a17-ca5c-d4c3-2ddbc0e5054c" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature index 60e9df68bb9..02caf02ff34 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature @@ -9,7 +9,7 @@ Feature: Security Monitoring And a valid "appKeyAuth" key in the system And an instance of "SecurityMonitoring" API - @skip @team:DataDog/k9-investigation + @team:DataDog/k9-investigation Scenario: Attach security finding to a Jira issue returns "OK" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} @@ -30,21 +30,21 @@ Feature: Security Monitoring And the response "data.attributes.status_group" is equal to "SG_OPEN" And the response "data.attributes.insights" has item with field "resource_id" with value "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" - @skip @team:DataDog/k9-investigation + @team:DataDog/k9-investigation Scenario: Attach security findings to a Jira issue returns "Bad Request" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": []}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} When the request is sent Then the response status is 400 Bad Request - @skip @team:DataDog/k9-investigation + @team:DataDog/k9-investigation Scenario: Attach security findings to a Jira issue returns "Not Found" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "wrong-finding-id", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} When the request is sent Then the response status is 404 Not Found - @skip @team:DataDog/k9-investigation + @team:DataDog/k9-investigation Scenario: Attach security findings to a Jira issue returns "OK" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}, {"id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} @@ -258,27 +258,75 @@ Feature: Security Monitoring Then the response status is 200 OK And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"_{{ unique_hash }}\" {\n\tname = \"_{{ unique_hash }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\thas_optional_group_by_fields = false\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n" - @generated @skip @team:DataDog/k9-investigation + @team:DataDog/k9-investigation + Scenario: Create Jira issue for security finding returns "Created" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "YmNlZmJhYTcyMDU5ZDk0ZDhiNjRmNGI0NDk4MDdiNzN-MDJlMjg0NzNmYzJiODY2MzJkNjU0OTI4NmVhZTUyY2U=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "YmNlZmJhYTcyMDU5ZDk0ZDhiNjRmNGI0NDk4MDdiNzN-MDJlMjg0NzNmYzJiODY2MzJkNjU0OTI4NmVhZTUyY2U=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + + @team:DataDog/k9-investigation + Scenario: Create Jira issue for security findings returns "Created" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==", "type": "findings"}, {"id": "eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 2 + And the response "data[0].attributes.insights[1].resource_id" is equal to "eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==" + And the response "data[0].attributes.insights[1].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.insights[0].resource_id" is equal to "a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + + @team:DataDog/k9-investigation Scenario: Create Jira issues for security findings returns "Bad Request" response - Given operation "CreateJiraIssues" enabled - And new "CreateJiraIssues" request - And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the Jira issue.", "fields": {"key1": "value", "key2": ["value"], "key3": {"key4": "value"}}, "priority": "NOT_DEFINED", "title": "A title for the Jira issue."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "jira_issues"}]} + Given new "CreateJiraIssues" request + And body with value {"data": [{"attributes": {}, "relationships": {"findings": {"data": []}, "project": {"data": {"id": "7f198869-c7ef-4afc-97cf-da5cdc13b5c3", "type": "projects"}}}, "type": "jira_issues"}]} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/k9-investigation + @team:DataDog/k9-investigation Scenario: Create Jira issues for security findings returns "Created" response - Given operation "CreateJiraIssues" enabled - And new "CreateJiraIssues" request - And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the Jira issue.", "fields": {"key1": "value", "key2": ["value"], "key3": {"key4": "value"}}, "priority": "NOT_DEFINED", "title": "A title for the Jira issue."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "jira_issues"}]} + Given new "CreateJiraIssues" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}, {"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}]} When the request is sent Then the response status is 201 Created + And the response "data" has length 2 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + And the response "data[1]" has field "id" + And the response "data[1].attributes.title" is equal to "A title" + And the response "data[1].attributes.description" is equal to "A description" + And the response "data[1].attributes.type" is equal to "SECURITY" + And the response "data[1].attributes.insights" has length 1 + And the response "data[1].attributes.insights[0].resource_id" is equal to "a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==" + And the response "data[1].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[1].attributes.jira_issue.status" is equal to "COMPLETED" - @generated @skip @team:DataDog/k9-investigation + @team:DataDog/k9-investigation Scenario: Create Jira issues for security findings returns "Not Found" response - Given operation "CreateJiraIssues" enabled - And new "CreateJiraIssues" request - And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the Jira issue.", "fields": {"key1": "value", "key2": ["value"], "key3": {"key4": "value"}}, "priority": "NOT_DEFINED", "title": "A title for the Jira issue."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "jira_issues"}]} + Given new "CreateJiraIssues" request + And body with value {"data": [{"attributes": {}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}, "project": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "projects"}}}, "type": "jira_issues"}]} When the request is sent Then the response status is 404 Not Found