diff --git a/docs/docs/administration/settings/plugins/configuring-slack.mdx b/docs/docs/administration/settings/plugins/configuring-slack.mdx index 610a8e27a342..0268c35ad689 100644 --- a/docs/docs/administration/settings/plugins/configuring-slack.mdx +++ b/docs/docs/administration/settings/plugins/configuring-slack.mdx @@ -191,6 +191,7 @@ You can override their values if you wish to do so. Included below are their des | `/dispatch-notifications-group` | Opens a modal to edit the notifications group. | | `/dispatch-update-participant` | Opens a modal to update participant metadata. | | `/dispatch-create-task` | Opens a modal to create an incident task. | +| `/dispatch-create-case` | Opens a modal to create a case. | ### Contact Information Resolver Plugin diff --git a/docs/docs/user-guide/incidents/commander.mdx b/docs/docs/user-guide/incidents/commander.mdx index 4a3b4c7323ac..72c0fbd8181a 100644 --- a/docs/docs/user-guide/incidents/commander.mdx +++ b/docs/docs/user-guide/incidents/commander.mdx @@ -28,6 +28,7 @@ All Slack commands are listed below, or you may view _groups_ of commands relati - [`/dispatch-update-participant`](#%2Fdispatch-update-participant) - [`/dispatch-run-workflow`](#%2Fdispatch-list-workflow) - [`/dispatch-create-task`](#%2Fdispatch-create-task) +- [`/dispatch-create-case`](#%2Fdispatch-create-case) ## People These commands help manage the people helping resolve the incident. @@ -215,3 +216,11 @@ This command will create a task for the current incident. ![](/img/slack-conversation-create-task.png) + +### /dispatch-create-case + +This command will create a case for the current incident. + +
+ +
diff --git a/src/dispatch/plugins/dispatch_slack/case/interactive.py b/src/dispatch/plugins/dispatch_slack/case/interactive.py index a69e4e25b868..942a5eabf034 100644 --- a/src/dispatch/plugins/dispatch_slack/case/interactive.py +++ b/src/dispatch/plugins/dispatch_slack/case/interactive.py @@ -128,6 +128,8 @@ def configure(config: SlackConversationConfiguration): case_command_context_middleware, ] + app.command(config.slack_command_create_case, middleware=[db_middleware])(report_issue) + app.command(config.slack_command_escalate_case, middleware=middleware)( handle_escalate_case_command ) @@ -1711,7 +1713,6 @@ def report_issue( client: WebClient, context: BoltContext, db_session: Session, - shortcut: dict, ): ack() initial_description = None @@ -1748,7 +1749,8 @@ def report_issue( callback_id=CaseReportActions.submit, private_metadata=context["subject"].json(), ).build() - client.views_open(trigger_id=shortcut["trigger_id"], view=modal) + + client.views_open(trigger_id=body["trigger_id"], view=modal) @app.action(CaseReportActions.project_select, middleware=[db_middleware, action_context_middleware]) diff --git a/src/dispatch/plugins/dispatch_slack/config.py b/src/dispatch/plugins/dispatch_slack/config.py index 541d6aa678a8..5381d4b46ce4 100644 --- a/src/dispatch/plugins/dispatch_slack/config.py +++ b/src/dispatch/plugins/dispatch_slack/config.py @@ -101,6 +101,11 @@ class SlackConversationConfiguration(SlackConfiguration): title="Engage Oncall Command String", description="Defines the string used to engage an oncall. Must match what is defined in Slack.", ) + slack_command_create_case: str = Field( + "/dispatch-create-case", + title="Create Case Command String", + description="Defines the string used to create a case. Must match what is defined in Slack.", + ) slack_command_update_case: str = Field( "/dispatch-update-case", title="Update Case Command String", diff --git a/src/dispatch/plugins/dispatch_slack/messaging.py b/src/dispatch/plugins/dispatch_slack/messaging.py index 7ab15196a035..50d8493df0dc 100644 --- a/src/dispatch/plugins/dispatch_slack/messaging.py +++ b/src/dispatch/plugins/dispatch_slack/messaging.py @@ -134,6 +134,10 @@ def get_incident_conversation_command_message( "response_type": "ephemeral", "text": "Opening a dialog to create a new incident task...", }, + config.slack_command_create_case: { + "response_type": "ephemeral", + "text": "Opening a dialog to create a new case...", + }, } return command_messages.get(command_string, default)