Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(conversations): add personal favorites to saved ticket views (#72532)

Luke Belton66210b6b29d6
diff --git a/.semgrep/rules/security/idor-team-scoped-models.yaml b/.semgrep/rules/security/idor-team-scoped-models.yaml
index d0a2d7ff4ab5..75879d11a5a8 100644
--- a/.semgrep/rules/security/idor-team-scoped-models.yaml
+++ b/.semgrep/rules/security/idor-team-scoped-models.yaml
@@ -288,6 +288,7 @@ rules:
|TeamConversationsTeamsConfig
|Ticket
|TicketView
+ |TicketViewFavorite
|ZendeskImportJob
|ReviewQueue
|ReviewQueueItem
@@ -591,6 +592,7 @@ rules:
|TeamConversationsTeamsConfig
|Ticket
|TicketView
+ |TicketViewFavorite
|ZendeskImportJob
|ReviewQueue
|ReviewQueueItem
diff --git a/products/conversations/backend/api/tests/test_ticket_views.py b/products/conversations/backend/api/tests/test_ticket_views.py
index b327279be024..03fb182849c5 100644
--- a/products/conversations/backend/api/tests/test_ticket_views.py
+++ b/products/conversations/backend/api/tests/test_ticket_views.py
@@ -7,7 +7,7 @@ from rest_framework.test import APIClient
from posthog.models.team.team import Team
-from products.conversations.backend.models import TicketView
+from products.conversations.backend.models import TicketView, TicketViewFavorite
class TestTicketViewAPI(APIBaseTest):
@@ -197,6 +197,69 @@ class TestTicketViewAPI(APIBaseTest):
assert response.status_code == status.HTTP_404_NOT_FOUND
assert TicketView.objects.filter(pk=other_view.id).exists()
+ # --- Personal favorites ---
+
+ def test_favorite_and_unfavorite(self):
+ created = self._create_via_api()
+
+ response = self.client.patch(f"{self.base_url}{created['short_id']}/", {"is_favorited": True}, format="json")
+ assert response.status_code == status.HTTP_200_OK
+ assert response.json()["is_favorited"] is True
+ assert (
+ TicketViewFavorite.objects.for_team(self.team.pk)
+ .filter(ticket_view_id=created["id"], user=self.user)
+ .count()
+ == 1
+ )
+
+ # Idempotent: favoriting again doesn't create a second row
+ self.client.patch(f"{self.base_url}{created['short_id']}/", {"is_favorited": True}, format="json")
+ assert (
+ TicketViewFavorite.objects.for_team(self.team.pk)
+ .filter(ticket_view_id=created["id"], user=self.user)
+ .count()
+ == 1
+ )
+
+ response = self.client.patch(f"{self.base_url}{created['short_id']}/", {"is_favorited": False}, format="json")
+ assert response.json()["is_favorited"] is False
+ assert (
+ not TicketViewFavorite.objects.for_team(self.team.pk)
+ .filter(ticket_view_id=created["id"], user=self.user)
+ .exists()
+ )
+
+ @parameterized.expand([("favorited", True), ("not_favorited", False)])
+ def test_create_with_favorited_flag(self, _label, favorited):
+ data = self._create_via_api(is_favorited=favorited)
+ assert data["is_favorited"] is favorited
+ assert (
+ TicketViewFavorite.objects.for_team(self.team.pk).filter(ticket_view_id=data["id"], user=self.user).exists()
+ is favorited
+ )
+
+ def test_favorites_are_personal_to_each_user(self):
+ created = self._create_via_api()
+ self.client.patch(f"{self.base_url}{created['short_id']}/", {"is_favorited": True}, format="json")
+
+ other_user = self._create_user("[email protected]")
+ other_client = APIClient()
+ other_client.force_login(other_user)
+
+ response = other_client.get(self.base_url)
+ assert response.json()["results"][0]["is_favorited"] is False
+
+ def test_favorited_views_sort_to_top(self):
+ older = self._create_via_api(name="Older")
+ self._create_via_api(name="Newer")
+
+ # Default order is newest-first; favoriting the older view must float it up
+ self.client.patch(f"{self.base_url}{older['short_id']}/", {"is_favorited": True}, format="json")
+
+ results = self.client.get(self.base_url).json()["results"]
+ assert [r["name"] for r in results] == ["Older", "Newer"]
+ assert results[0]["is_favorited"] is True
+
# --- Auth ---
def test_unauthorized_access(self):
diff --git a/products/conversations/backend/api/ticket_views.py b/products/conversations/backend/api/ticket_views.py
index 9ddaeb30583c..7ecf8707ad80 100644
--- a/products/conversations/backend/api/ticket_views.py
+++ b/products/conversations/backend/api/ticket_views.py
@@ -1,5 +1,7 @@
import json
-from typing import Any
+from typing import TYPE_CHECKING, Any, cast
+
+from django.db.models import Exists, OuterRef
from rest_framework import mixins, serializers, viewsets
@@ -7,7 +9,10 @@ from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.api.shared import UserBasicSerializer
from posthog.event_usage import report_user_action
-from products.conversations.backend.models import TicketView
+from products.conversations.backend.models import TicketView, TicketViewFavorite
+
+if TYPE_CHECKING:
+ from posthog.models import User
MAX_FILTERS_SIZE_BYTES = 10_000
@@ -19,6 +24,10 @@ class TicketViewSerializer(serializers.ModelSerializer):
default=dict,
help_text="Saved ticket filter criteria. May contain status, priority, channel, sla, assignee, tags, dateFrom, dateTo, and sorting keys.",
)
+ is_favorited = serializers.BooleanField(
+ required=False,
+ help_text="Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user.",
+ )
def validate_filters(self, value: dict) -> dict:
if len(json.dumps(value)) > MAX_FILTERS_SIZE_BYTES:
@@ -34,6 +43,7 @@ class TicketViewSerializer(serializers.ModelSerializer):
"filters",
"created_at",
"created_by",
+ "is_favorited",
]
read_only_fields = [
"id",
@@ -42,10 +52,30 @@ class TicketViewSerializer(serializers.ModelSerializer):
"created_by",
]
+ def _set_favorited(self, instance: TicketView, favorited: bool) -> None:
+ user = self.context["request"].user
+ if favorited:
+ TicketViewFavorite.objects.get_or_create(team=instance.team, ticket_view=instance, user=user)
+ else:
+ TicketViewFavorite.objects.filter(team=instance.team, ticket_view=instance, user=user).delete()
+
def create(self, validated_data: dict[str, Any], *args: Any, **kwargs: Any) -> TicketView:
+ is_favorited = validated_data.pop("is_favorited", False)
validated_data["team_id"] = self.context["team_id"]
validated_data["created_by"] = self.context["request"].user
- return super().create(validated_data)
+ instance = super().create(validated_data)
+ if is_favorited:
+ self._set_favorited(instance, True)
+ instance.is_favorited = bool(is_favorited)
+ return instance
+
+ def update(self, instance: TicketView, validated_data: dict[str, Any]) -> TicketView:
+ is_favorited = validated_data.pop("is_favorited", None)
+ instance = super().update(instance, validated_data)
+ if is_favorited is not None:
+ self._set_favorited(instance, is_favorited)
+ instance.is_favorited = is_favorited
+ return instance
class TicketViewViewSet(
@@ -69,6 +99,11 @@ class TicketViewViewSet(
def safely_get_queryset(self, queryset: Any) -> Any:
queryset = queryset.filter(team_id=self.team_id)
queryset = queryset.select_related("created_by")
+ # Personal favorites float to the top, for the requesting user only.
+ favorited_by_user = TicketViewFavorite.objects.filter(
+ ticket_view_id=OuterRef("pk"), user=cast("User", self.request.user)
+ )
+ queryset = queryset.annotate(is_favorited=Exists(favorited_by_user)).order_by("-is_favorited", "-created_at")
return queryset
def _track(self, event: str, instance: TicketView) -> None:
diff --git a/products/conversations/backend/migrations/0051_ticketviewfavorite.py b/products/conversations/backend/migrations/0051_ticketviewfavorite.py
new file mode 100644
index 000000000000..87ef149ff8f2
--- /dev/null
+++ b/products/conversations/backend/migrations/0051_ticketviewfavorite.py
@@ -0,0 +1,54 @@
+import django.db.models.deletion
+from django.conf import settings
+from django.db import migrations, models
+
+import posthog.models.utils
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ("conversations", "0050_alter_ticket_priority"),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name="TicketViewFavorite",
+ fields=[
+ (
+ "id",
+ models.UUIDField(
+ default=posthog.models.utils.uuid7, editable=False, primary_key=True, serialize=False
+ ),
+ ),
+ ("created_at", models.DateTimeField(auto_now_add=True)),
+ (
+ "team",
+ models.ForeignKey(
+ db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to="posthog.team"
+ ),
+ ),
+ (
+ "ticket_view",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="favorites",
+ to="conversations.ticketview",
+ ),
+ ),
+ (
+ "user",
+ models.ForeignKey(
+ db_constraint=False,
+ on_delete=django.db.models.deletion.CASCADE,
+ to=settings.AUTH_USER_MODEL,
+ ),
+ ),
+ ],
+ options={
+ "db_table": "posthog_conversations_ticket_view_favorites",
+ "unique_together": {("ticket_view", "user")},
+ "indexes": [models.Index(fields=["team_id", "user"], name="conv_ticket_view_fav_idx")],
+ },
+ ),
+ ]
diff --git a/products/conversations/backend/migrations/max_migration.txt b/products/conversations/backend/migrations/max_migration.txt
index fd5be3808f75..bbc9a1c655d3 100644
--- a/products/conversations/backend/migrations/max_migration.txt
+++ b/products/conversations/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0050_alter_ticket_priority
+0051_ticketviewfavorite
diff --git a/products/conversations/backend/models/__init__.py b/products/conversations/backend/models/__init__.py
index 7a3d7b3b13ba..c10aad9336b8 100644
--- a/products/conversations/backend/models/__init__.py
+++ b/products/conversations/backend/models/__init__.py
@@ -10,6 +10,7 @@ from .team_conversations_teams_channel_sync import TeamConversationsTeamsChannel
from .team_conversations_teams_config import TeamConversationsTeamsConfig
from .ticket import Ticket
from .ticket_view import TicketView
+from .ticket_view_favorite import TicketViewFavorite
from .zendesk_import_job import ZendeskImportJob
__all__ = [
@@ -29,5 +30,6 @@ __all__ = [
"Ticket",
"TicketAssignment",
"TicketView",
+ "TicketViewFavorite",
"ZendeskImportJob",
]
diff --git a/products/conversations/backend/models/ticket_view.py b/products/conversations/backend/models/ticket_view.py
index c4d17663d4af..020c1c238ece 100644
--- a/products/conversations/backend/models/ticket_view.py
+++ b/products/conversations/backend/models/ticket_view.py
@@ -12,6 +12,9 @@ class TicketView(CreatedMetaFields, UpdatedMetaFields, UUIDModel):
name = models.CharField(max_length=400)
filters = models.JSONField(default=dict)
+ # Not a column — a per-request annotation set by the viewset/serializer.
+ is_favorited: bool
+
class Meta:
db_table = "posthog_conversations_tickets_views"
unique_together = ("team", "short_id")
diff --git a/products/conversations/backend/models/ticket_view_favorite.py b/products/conversations/backend/models/ticket_view_favorite.py
new file mode 100644
index 000000000000..ba2b9f86a41c
--- /dev/null
+++ b/products/conversations/backend/models/ticket_view_favorite.py
@@ -0,0 +1,28 @@
+from __future__ import annotations
+
+from django.conf import settings
+from django.db import models
+
+from posthog.models.scoping.root_mixin import TeamScopedRootMixin
+from posthog.models.utils import UUIDModel
+
+from .ticket_view import TicketView
+
+
+class TicketViewFavorite(TeamScopedRootMixin, UUIDModel):
+ # db_constraint=False on the hot-table FKs (team, user) so CreateModel takes no lock
+ # on posthog_team / posthog_user; app-level enforcement is enough here.
+ team = models.ForeignKey("posthog.Team", on_delete=models.CASCADE, db_constraint=False)
+ ticket_view = models.ForeignKey(TicketView, on_delete=models.CASCADE, related_name="favorites")
+ user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, db_constraint=False)
+ created_at = models.DateTimeField(auto_now_add=True)
+
+ class Meta:
+ db_table = "posthog_conversations_ticket_view_favorites"
+ unique_together = ("ticket_view", "user")
+ indexes = [
+ models.Index(fields=["team_id", "user"], name="conv_ticket_view_fav_idx"),
+ ]
+
+ def __str__(self) -> str:
+ return f"{self.user} favorited {self.ticket_view}"
diff --git a/products/conversations/frontend/components/SavedViews/SavedViewsButton.tsx b/products/conversations/frontend/components/SavedViews/SavedViewsButton.tsx
index b115b991969a..fa2481172b1f 100644
--- a/products/conversations/frontend/components/SavedViews/SavedViewsButton.tsx
+++ b/products/conversations/frontend/components/SavedViews/SavedViewsButton.tsx
@@ -1,38 +1,62 @@
import { useActions, useValues } from 'kea'
import { IconBookmark, IconX } from '@posthog/icons'
-import { LemonButton } from '@posthog/lemon-ui'
+import { LemonButton, LemonMenu } from '@posthog/lemon-ui'
import { supportTicketsSceneLogic } from '../../scenes/tickets/supportTicketsSceneLogic'
import { SavedViewsModal } from './SavedViewsModal'
import { type TicketViewsLogicProps, ticketViewsLogic } from './ticketViewsLogic'
function SavedViewsButtonInner({ id }: TicketViewsLogicProps): JSX.Element {
- const { openModal } = useActions(ticketViewsLogic({ id }))
+ const { favoriteViews, viewsLoading } = useValues(ticketViewsLogic({ id }))
+ const { openModal, loadView, loadViews } = useActions(ticketViewsLogic({ id }))
const { activeView } = useValues(supportTicketsSceneLogic)
const { resetFilters } = useActions(supportTicketsSceneLogic)
return (
<>
- <LemonButton
- size="small"
- type="secondary"
- icon={<IconBookmark />}
- onClick={openModal}
- active={!!activeView}
- tooltip={activeView ? `Viewing "${activeView.name}"` : undefined}
- sideAction={
- activeView
- ? {
- icon: <IconX />,
- onClick: resetFilters,
- tooltip: 'Clear view and reset filters',
- }
- : undefined
- }
+ <LemonMenu
+ placement="bottom-start"
+ onVisibilityChange={(visible) => visible && loadViews()}
+ items={[
+ {
+ title: 'Favorites',
+ items: favoriteViews.length
+ ? favoriteViews.map((view) => ({
+ label: view.name,
+ onClick: () => loadView(view),
+ }))
+ : [
+ {
+ label: viewsLoading ? 'Loading…' : 'No favorite views yet',
+ disabledReason: 'Favorite a view to see it here',
+ },
+ ],
+ },
+ {
+ items: [{ label: 'All saved views', onClick: openModal }],
+ },
+ ]}
>
- {activeView ? <span className="max-w-50 truncate">{activeView.name}</span> : 'Saved views'}
- </LemonButton>
+ <LemonButton
+ size="small"
+ type="secondary"
+ icon={<IconBookmark />}
+ active={!!activeView}
+ tooltip={activeView ? `Viewing "${activeView.name}"` : undefined}
+ sideAction={
+ activeView
+ ? {
+ icon: <IconX />,
+ onClick: resetFilters,
+ tooltip: 'Clear view and reset filters',
+ }
+ : undefined
+ }
+ >
+ {activeView ? <span className="max-w-50 truncate">{activeView.name}</span> : 'Saved views'}
+ </LemonButton>
+ </LemonMenu>
<SavedViewsModal id={id} />
</>
)
diff --git a/products/conversations/frontend/components/SavedViews/SavedViewsModal.tsx b/products/conversations/frontend/components/SavedViews/SavedViewsModal.tsx
index 81f056873c7b..22d4c9a75d25 100644
--- a/products/conversations/frontend/components/SavedViews/SavedViewsModal.tsx
+++ b/products/conversations/frontend/components/SavedViews/SavedViewsModal.tsx
@@ -1,6 +1,7 @@
import { useActions, useValues } from 'kea'
import type { ReactNode } from 'react'
+import { IconHeart, IconHeartFilled } from '@posthog/icons'
import { LemonButton, LemonDialog, LemonInput, LemonModal, LemonTable, LemonTableColumns } from '@posthog/lemon-ui'
import { TZLabel } from 'lib/components/TZLabel'
@@ -113,10 +114,34 @@ function SaveViewModal({ id }: TicketViewsLogicProps): JSX.Element {
}
export function SavedViewsModal({ id }: TicketViewsLogicProps): JSX.Element {
- const { isModalOpen, views, viewsLoading, currentFilters } = useValues(ticketViewsLogic({ id }))
- const { closeModal, openSaveModal, deleteView, loadView, updateView } = useActions(ticketViewsLogic({ id }))
+ const { isModalOpen, sortedViews, viewsLoading, currentFilters, favoritingShortIds } = useValues(
+ ticketViewsLogic({ id })
+ )
+ const { closeModal, openSaveModal, deleteView, loadView, updateView, toggleFavorite } = useActions(
+ ticketViewsLogic({ id })
+ )
const columns: LemonTableColumns<SavedTicketView> = [
+ {
+ title: '',
+ key: 'favorite',
+ width: 0,
+ render: (_, view) => (
+ <LemonButton
+ size="xsmall"
+ loading={favoritingShortIds.includes(view.short_id)}
+ onClick={() => toggleFavorite(view)}
+ icon={
+ view.is_favorited ? (
+ <IconHeartFilled className="text-danger" />
+ ) : (
+ <IconHeart className="text-secondary" />
+ )
+ }
+ tooltip={view.is_favorited ? 'Remove from favorites' : 'Add to favorites'}
+ />
+ ),
+ },
{
title: 'Name',
dataIndex: 'name',
@@ -248,7 +273,7 @@ export function SavedViewsModal({ id }: TicketViewsLogicProps): JSX.Element {
>
<LemonTable
columns={columns}
- dataSource={views}
+ dataSource={sortedViews}
rowKey="id"
loading={viewsLoading}
emptyState="No saved views yet."
diff --git a/products/conversations/frontend/components/SavedViews/ticketViewsLogic.ts b/products/conversations/frontend/components/SavedViews/ticketViewsLogic.ts
index 6229dce92929..975ca16db5d4 100644
--- a/products/conversations/frontend/components/SavedViews/ticketViewsLogic.ts
+++ b/products/conversations/frontend/components/SavedViews/ticketViewsLogic.ts
@@ -1,4 +1,4 @@
-import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { lemonToast } from '@posthog/lemon-ui'
@@ -22,6 +22,7 @@ export interface TicketViewsLogicProps {
export interface TicketViewChanges {
name?: string
filters?: TicketViewFilters
+ is_favorited?: boolean
}
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
@@ -29,8 +30,11 @@ export interface ticketViewsLogicValues {
activeView: SavedTicketView | null // supportTicketsSceneLogic
currentFilters: TicketViewFilters // supportTicketsSceneLogic
currentTeamId: number | null // teamLogic
+ favoriteViews: SavedTicketView[]
+ favoritingShortIds: string[]
isModalOpen: boolean
isSaveModalOpen: boolean
+ sortedViews: SavedTicketView[]
viewName: string
views: SavedTicketView[]
viewsLoading: boolean
@@ -107,6 +111,9 @@ export interface ticketViewsLogicActions {
setViewName: (viewName: string) => {
viewName: string
}
+ toggleFavorite: (view: SavedTicketView) => {
+ view: SavedTicketView
+ }
updateView: (
shortId: string,
changes: TicketViewChanges
@@ -122,6 +129,10 @@ export interface ticketViewsLogicActions {
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface ticketViewsLogicMeta {
key: string
+ __keaTypeGenInternalSelectorTypes: {
+ sortedViews: (views: SavedTicketView[]) => SavedTicketView[]
+ favoriteViews: (sortedViews: SavedTicketView[]) => SavedTicketView[]
+ }
}
export type ticketViewsLogicType = MakeLogicType<
@@ -145,6 +156,7 @@ export const ticketViewsLogic = kea<ticketViewsLogicType>([
deleteView: (shortId: string) => ({ shortId }),
updateView: (shortId: string, changes: TicketViewChanges) => ({ shortId, changes }),
viewUpdated: (view: SavedTicketView) => ({ view }),
+ toggleFavorite: (view: SavedTicketView) => ({ view }),
loadView: (view: SavedTicketView) => ({ view }),
openModal: true,
closeModal: true,
@@ -179,6 +191,19 @@ export const ticketViewsLogic = kea<ticketViewsLogicType>([
deleteView: (state, { shortId }) => state.filter((v) => v.short_id !== shortId),
viewUpdated: (state, { view }) => state.map((v) => (v.short_id === view.short_id ? view : v)),
},
+ favoritingShortIds: [
+ [] as string[],
+ {
+ toggleFavorite: (state, { view }) =>
+ state.includes(view.short_id) ? state : [...state, view.short_id],
+ viewUpdated: (state, { view }) => state.filter((id) => id !== view.short_id),
+ // Clear on load completion (not the trigger) so opening the dropdown/modal
+ // mid-flight doesn't drop the in-flight state early; also covers the
+ // updateView failure path, which reloads views.
+ loadViewsSuccess: () => [],
+ loadViewsFailure: () => [],
+ },
+ ],
isModalOpen: [
false,
{
@@ -205,9 +230,32 @@ export const ticketViewsLogic = kea<ticketViewsLogicType>([
],
}),
+ selectors({
+ sortedViews: [
+ (s) => [s.views],
+ (views: SavedTicketView[]): SavedTicketView[] =>
+ [...views].sort((a, b) => {
+ if (a.is_favorited !== b.is_favorited) {
+ return a.is_favorited ? -1 : 1
+ }
+ return b.created_at.localeCompare(a.created_at)
+ }),
+ ],
+ favoriteViews: [
+ (s) => [s.sortedViews],
+ (sortedViews: SavedTicketView[]): SavedTicketView[] => sortedViews.filter((v) => v.is_favorited),
+ ],
+ }),
+
listeners(({ actions, values }) => ({
+ toggleFavorite: ({ view }) => {
+ actions.updateView(view.short_id, { is_favorited: !view.is_favorited })
+ },
openModal: () => {
- actions.loadViews()
+ // The header dropdown already loads views on open; skip a duplicate GET if one is in flight
+ if (!values.viewsLoading) {
+ actions.loadViews()
+ }
},
saveView: () => {
const name = values.viewName.trim()
@@ -237,7 +285,11 @@ export const ticketViewsLogic = kea<ticketViewsLogicType>([
if (values.activeView?.short_id === shortId) {
actions.setActiveView(updated)
}
- lemonToast.success('View updated')
+ // Favoriting is a quiet, high-frequency action — no toast for it
+ const isFavoriteToggleOnly = Object.keys(changes).length === 1 && 'is_favorited' in changes
+ if (!isFavoriteToggleOnly) {
+ lemonToast.success('View updated')
+ }
} catch {
lemonToast.error('Failed to update view')
actions.loadViews()
diff --git a/products/conversations/frontend/generated/api.schemas.ts b/products/conversations/frontend/generated/api.schemas.ts
index 7b63612ef21e..ce87fce75622 100644
--- a/products/conversations/frontend/generated/api.schemas.ts
+++ b/products/conversations/frontend/generated/api.schemas.ts
@@ -1050,6 +1050,8 @@ export interface TicketViewApi {
filters?: TicketViewApiFilters
readonly created_at: string
readonly created_by: UserBasicApi
+ /** Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user. */
+ is_favorited?: boolean
}
export interface PaginatedTicketViewListApi {
@@ -1075,6 +1077,8 @@ export interface PatchedTicketViewApi {
filters?: PatchedTicketViewApiFilters
readonly created_at?: string
readonly created_by?: UserBasicApi
+ /** Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user. */
+ is_favorited?: boolean
}
export interface ZendeskImportStartApi {
diff --git a/products/conversations/frontend/generated/api.zod.ts b/products/conversations/frontend/generated/api.zod.ts
index ec24b66a6d29..05b7e42c0cf6 100644
--- a/products/conversations/frontend/generated/api.zod.ts
+++ b/products/conversations/frontend/generated/api.zod.ts
@@ -405,6 +405,12 @@ export const ConversationsViewsCreateBody = /* @__PURE__ */ zod.object({
.describe(
'Saved ticket filter criteria. May contain status, priority, channel, sla, assignee, tags, dateFrom, dateTo, and sorting keys.'
),
+ is_favorited: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user.'
+ ),
})
export const conversationsViewsPartialUpdateBodyNameMax = 400
@@ -417,6 +423,12 @@ export const ConversationsViewsPartialUpdateBody = /* @__PURE__ */ zod.object({
.describe(
'Saved ticket filter criteria. May contain status, priority, channel, sla, assignee, tags, dateFrom, dateTo, and sorting keys.'
),
+ is_favorited: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user.'
+ ),
})
export const conversationsZendeskImportsCreateBodySubdomainMax = 255
diff --git a/products/conversations/frontend/types.ts b/products/conversations/frontend/types.ts
index 0916d6548697..93858a63e66f 100644
--- a/products/conversations/frontend/types.ts
+++ b/products/conversations/frontend/types.ts
@@ -115,6 +115,7 @@ export interface SavedTicketView {
filters: TicketViewFilters
created_at: string
created_by: { id: number; first_name?: string; email?: string } | null
+ is_favorited: boolean
}
export interface UserBasic {
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index a36801785ca5..7ec6d936eb70 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -42292,6 +42292,8 @@ export namespace Schemas {
filters?: TicketViewFilters;
readonly created_at: string;
readonly created_by: UserBasic;
+ /** Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user. */
+ is_favorited?: boolean;
}
export interface PaginatedTicketViewList {
@@ -50069,6 +50071,8 @@ export namespace Schemas {
filters?: PatchedTicketViewFilters;
readonly created_at?: string;
readonly created_by?: UserBasic;
+ /** Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user. */
+ is_favorited?: boolean;
}
/**