Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Commit 7e79ce3

Browse files
authored
Bookmark Incident Review document in the conversation after its creation (#2937)
1 parent 9174299 commit 7e79ce3

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/dispatch/incident/flows.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,29 @@ def incident_stable_status_flow(incident: Incident, db_session=None):
11251125
db_session,
11261126
)
11271127

1128+
# we bookmark the incident review document
1129+
plugin = plugin_service.get_active_instance(
1130+
db_session=db_session, project_id=incident.project.id, plugin_type="conversation"
1131+
)
1132+
if not plugin:
1133+
log.warning("Incident review document not bookmarked. No conversation plugin enabled.")
1134+
return
1135+
1136+
try:
1137+
plugin.instance.set_bookmark(
1138+
incident.conversation.channel_id,
1139+
resolve_attr(incident, "incident_review_document.weblink"),
1140+
title="Incident Review Document",
1141+
)
1142+
except Exception as e:
1143+
event_service.log_incident_event(
1144+
db_session=db_session,
1145+
source="Dispatch Core App",
1146+
description=f"Bookmarking the incident review document failed. Reason: {e}",
1147+
incident_id=incident.id,
1148+
)
1149+
log.exception(e)
1150+
11281151

11291152
def incident_closed_status_flow(incident: Incident, db_session=None):
11301153
"""Runs the incident closed flow."""

0 commit comments

Comments
 (0)