Create incident from slack fails if "Type" not provided
mrpea opened this issue · 3 comments
Describe the bug
Creating an incident from Slack fails if the user does not pick a Type from the dropdown.
To Reproduce
/dispatch-report-incident
- Fill out title, description, and Project.
- Hit "Report"
- Get error :/
Expected behavior
Either the Type is marked as required (and the submit button is disabled) or type is allowed to be null
Screenshots
Additional context
Log files show this:
ERROR:slack_bolt.App:1 validation error for IncidentTypeRead
incident_type
No default incident type defined. (type=value_error.not_found; msg=No default incident type defined.)
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/slack_bolt/listener/thread_runner.py", line 120, in run_ack_function_asynchronously
listener.run_ack_function(request=request, response=response)
File "/usr/local/lib/python3.11/site-packages/slack_bolt/listener/custom_listener.py", line 50, in run_ack_function
return self.ack_function(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dispatch/plugins/dispatch_slack/incident/interactive.py", line 1976, in handle_report_incident_submission_event
incident = incident_service.create(db_session=db_session, incident_in=incident_in)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dispatch/incident/service.py", line 157, in create
incident_type = incident_type_service.get_by_name_or_default(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dispatch/incident/type/service.py", line 88, in get_by_name_or_default
return get_default_or_raise(db_session=db_session, project_id=project_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dispatch/incident/type/service.py", line 33, in get_default_or_raise
raise ValidationError(
Hi @mrpea - when you go to "Settings", click on your Project name. Then on the submenu pane there is a section for Incident->Types. Please make sure that one of these Types is set as the default. Then you shouldn't see this error.
This issue is stale, because it has been open for 30 days with no activity. Remove the stale label or comment, or this will be closed in 5 days.
This issue was closed, because it has been stalled for 5 days with no activity.