From 7eaec16381a2ec1b3979567713c559f3b29d74bc Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Thu, 30 Mar 2023 01:25:16 +0530 Subject: [PATCH] chore: add cycle id and module id in issues list endpoint (#586) --- apiserver/plane/api/serializers/issue.py | 2 ++ apiserver/plane/api/views/issue.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/apiserver/plane/api/serializers/issue.py b/apiserver/plane/api/serializers/issue.py index fdc5e4b68..4dc62f2d9 100644 --- a/apiserver/plane/api/serializers/issue.py +++ b/apiserver/plane/api/serializers/issue.py @@ -486,6 +486,8 @@ class IssueLiteSerializer(BaseSerializer): label_details = LabelLiteSerializer(read_only=True, source="labels", many=True) assignee_details = UserLiteSerializer(read_only=True, source="assignees", many=True) sub_issues_count = serializers.IntegerField(read_only=True) + cycle_id = serializers.UUIDField(read_only=True) + module_id = serializers.UUIDField(read_only=True) class Meta: model = Issue diff --git a/apiserver/plane/api/views/issue.py b/apiserver/plane/api/views/issue.py index 165b3e373..116a13033 100644 --- a/apiserver/plane/api/views/issue.py +++ b/apiserver/plane/api/views/issue.py @@ -150,6 +150,8 @@ class IssueViewSet(BaseViewSet): self.get_queryset() .order_by(request.GET.get("order_by", "created_at")) .filter(**filters) + .annotate(cycle_id=F("issue_cycle__id")) + .annotate(module_id=F("issue_module__id")) ) issue_queryset = (