Incident API: include 'title' and permalinks in serializer (#2480)
Grafana Incident is attempting to load the title and Slack thread link from attached OnCall alert groups, but those fields aren't being exposed by the OnCall API for Grafana Incident. This commit changes that and exposes those fields.
This commit is contained in:
parent
2ab775ae64
commit
bb53b8fc4f
1 changed files with 2 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ class AlertGroupSerializer(serializers.ModelSerializer):
|
|||
id = serializers.CharField(read_only=True, source="public_primary_key")
|
||||
status = serializers.SerializerMethodField(source="get_status")
|
||||
link = serializers.CharField(read_only=True, source="web_link")
|
||||
title = serializers.CharField(read_only=True, source="long_verbose_name_without_formatting")
|
||||
alerts = AlertSerializer(many=True, read_only=True)
|
||||
|
||||
def get_status(self, obj):
|
||||
|
|
@ -35,4 +36,5 @@ class AlertGroupSerializer(serializers.ModelSerializer):
|
|||
"link",
|
||||
"status",
|
||||
"alerts",
|
||||
"title",
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue