Browse Source

feat(priority): Add priorityLockedAt to serializer (#64430)

Similar to https://github.com/getsentry/sentry/pull/63868
Julia Hoge 1 year ago
parent
commit
b52984d8cf

+ 1 - 0
src/sentry/api/serializers/models/group.py

@@ -353,6 +353,7 @@ class GroupSerializerBase(Serializer, ABC):
         if features.has("projects:issue-priority", obj.project, actor=None):
             priority_label = PRIORITY_LEVEL_TO_STR[obj.priority] if obj.priority else None
             group_dict["priority"] = priority_label
+            group_dict["priorityLockedAt"] = obj.priority_locked_at
 
         # This attribute is currently feature gated
         if "is_unhandled" in attrs:

+ 2 - 0
tests/snuba/api/serializers/test_group.py

@@ -52,6 +52,7 @@ class GroupSerializerSnubaTest(APITestCase, SnubaTestCase):
         group = self.create_group()
         result = serialize(group, outside_user, serializer=GroupSerializerSnuba())
         assert "priority" not in result
+        assert "priorityLockedAt" not in result
 
     @with_feature("projects:issue-priority")
     def test_priority_high(self):
@@ -73,6 +74,7 @@ class GroupSerializerSnubaTest(APITestCase, SnubaTestCase):
         group = self.create_group()
         result = serialize(group, outside_user, serializer=GroupSerializerSnuba())
         assert result["priority"] is None
+        assert result["priorityLockedAt"] is None
 
     def test_is_ignored_with_expired_snooze(self):
         now = django_timezone.now()