-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ResponseOps][Connectors] Allow to use POST method for get case information in case management webhook #197437
[ResponseOps][Connectors] Allow to use POST method for get case information in case management webhook #197437
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
…ub.com/js-jankisalvi/kibana into case-management-webhook-post-case-info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good, just need to limit the Get step to GET
and POST
x-pack/plugins/stack_connectors/public/connector_types/cases_webhook/steps/get.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
...ng_api_integration/security_and_spaces/group2/tests/actions/connector_types/cases_webhook.ts
Outdated
Show resolved
Hide resolved
}) | ||
: null; | ||
|
||
if (json !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be
if (json !== null) { | |
if (getIncidentMethod === WebhookMethods.POST && json !== null) { |
I'm not sure 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am checking this at line 120:
const json = getIncidentMethod === WebhookMethods.POST && getIncidentJson
? renderMustacheStringNoEscape()
: null
So json
will be null if getIncidentMethod
is not WebhookMethods.POST
I saw that you do In the original enhancement request, the client uses Ansible, and a specific example is given.
But then I checked the documentation for this
I don't know what a job template is but it doesn't feel like it matches the view case scenario 😆 |
x-pack/plugins/stack_connectors/public/connector_types/cases_webhook/steps/get.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/stack_connectors/public/connector_types/cases_webhook/steps/get.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/stack_connectors/public/connector_types/cases_webhook/steps/get.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I left some small comments but the only thing I find more important is containsExternalIdForPost
i'd be up for removing it wdyt?
Ah and also the comment about the original feature request. I hope this fixes it for them but I dunno if this isn't a case of misconfiguring the connector :D
Agree, The docs does not show any POST method to get job templates information. But using a post to get data is possible with some APIs. So I think it's a good option to provide.
Do you think we should ask them? @cnasikas |
I also agree. We should go with the feature either way as it is a valid scenario. |
💚 Build Succeeded
Metrics [docs]Async chunks
History
|
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11723252200 |
…mation in case management webhook (elastic#197437) ## Summary Resolves elastic#178074 This PR allows to use POST method and JSON payload for body for get case information in case management webhook. <img width="1279" alt="Screenshot 2024-10-24 at 15 02 33" src="https://github.com/user-attachments/assets/aaabc5b8-cd9e-46d6-aab8-85a27731bd88"> ### How to test - Create a case management webhook connector [as per documentation](https://www.elastic.co/guide/en/kibana/master/cases-webhook-action-type.html) - Use any public API which supports GET and POST methods - Use POST method for Get case information - Verify that it validates the URL and JSON payload correctly - Test the connector using Test tab - Create a rule with action using case management webhook connector - Verify alerts are generated and action executed without any errors ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) (cherry picked from commit d81d071)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… information in case management webhook (#197437) (#199307) # Backport This will backport the following commits from `main` to `8.x`: - [[ResponseOps][Connectors] Allow to use POST method for get case information in case management webhook (#197437)](#197437) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Janki Salvi","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-07T12:44:54Z","message":"[ResponseOps][Connectors] Allow to use POST method for get case information in case management webhook (#197437)\n\n## Summary\r\n\r\nResolves https://github.com/elastic/kibana/issues/178074\r\n\r\nThis PR allows to use POST method and JSON payload for body for get case\r\ninformation in case management webhook.\r\n\r\n<img width=\"1279\" alt=\"Screenshot 2024-10-24 at 15 02 33\"\r\nsrc=\"https://github.com/user-attachments/assets/aaabc5b8-cd9e-46d6-aab8-85a27731bd88\">\r\n\r\n### How to test\r\n- Create a case management webhook connector [as per\r\ndocumentation](https://www.elastic.co/guide/en/kibana/master/cases-webhook-action-type.html)\r\n- Use any public API which supports GET and POST methods \r\n- Use POST method for Get case information\r\n- Verify that it validates the URL and JSON payload correctly \r\n- Test the connector using Test tab\r\n- Create a rule with action using case management webhook connector\r\n- Verify alerts are generated and action executed without any errors\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))","sha":"d81d0716a7007132d4a8210d1739e3f38a2c8cf9","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","v9.0.0","Feature:Actions/ConnectorsManagement","backport:prev-minor","v8.17.0"],"title":"[ResponseOps][Connectors] Allow to use POST method for get case information in case management webhook","number":197437,"url":"https://github.com/elastic/kibana/pull/197437","mergeCommit":{"message":"[ResponseOps][Connectors] Allow to use POST method for get case information in case management webhook (#197437)\n\n## Summary\r\n\r\nResolves https://github.com/elastic/kibana/issues/178074\r\n\r\nThis PR allows to use POST method and JSON payload for body for get case\r\ninformation in case management webhook.\r\n\r\n<img width=\"1279\" alt=\"Screenshot 2024-10-24 at 15 02 33\"\r\nsrc=\"https://github.com/user-attachments/assets/aaabc5b8-cd9e-46d6-aab8-85a27731bd88\">\r\n\r\n### How to test\r\n- Create a case management webhook connector [as per\r\ndocumentation](https://www.elastic.co/guide/en/kibana/master/cases-webhook-action-type.html)\r\n- Use any public API which supports GET and POST methods \r\n- Use POST method for Get case information\r\n- Verify that it validates the URL and JSON payload correctly \r\n- Test the connector using Test tab\r\n- Create a rule with action using case management webhook connector\r\n- Verify alerts are generated and action executed without any errors\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))","sha":"d81d0716a7007132d4a8210d1739e3f38a2c8cf9"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197437","number":197437,"mergeCommit":{"message":"[ResponseOps][Connectors] Allow to use POST method for get case information in case management webhook (#197437)\n\n## Summary\r\n\r\nResolves https://github.com/elastic/kibana/issues/178074\r\n\r\nThis PR allows to use POST method and JSON payload for body for get case\r\ninformation in case management webhook.\r\n\r\n<img width=\"1279\" alt=\"Screenshot 2024-10-24 at 15 02 33\"\r\nsrc=\"https://github.com/user-attachments/assets/aaabc5b8-cd9e-46d6-aab8-85a27731bd88\">\r\n\r\n### How to test\r\n- Create a case management webhook connector [as per\r\ndocumentation](https://www.elastic.co/guide/en/kibana/master/cases-webhook-action-type.html)\r\n- Use any public API which supports GET and POST methods \r\n- Use POST method for Get case information\r\n- Verify that it validates the URL and JSON payload correctly \r\n- Test the connector using Test tab\r\n- Create a rule with action using case management webhook connector\r\n- Verify alerts are generated and action executed without any errors\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))","sha":"d81d0716a7007132d4a8210d1739e3f38a2c8cf9"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Janki Salvi <[email protected]>
…mation in case management webhook (elastic#197437) ## Summary Resolves elastic#178074 This PR allows to use POST method and JSON payload for body for get case information in case management webhook. <img width="1279" alt="Screenshot 2024-10-24 at 15 02 33" src="https://github.com/user-attachments/assets/aaabc5b8-cd9e-46d6-aab8-85a27731bd88"> ### How to test - Create a case management webhook connector [as per documentation](https://www.elastic.co/guide/en/kibana/master/cases-webhook-action-type.html) - Use any public API which supports GET and POST methods - Use POST method for Get case information - Verify that it validates the URL and JSON payload correctly - Test the connector using Test tab - Create a rule with action using case management webhook connector - Verify alerts are generated and action executed without any errors ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
Summary
Resolves #178074
This PR allows to use POST method and JSON payload for body for get case information in case management webhook.
How to test
Checklist
Delete any items that are not applicable to this PR.