feat(core): Add ticket_category slash command

ref: #690 closes #598
This commit is contained in:
2025-03-17 15:38:55 +09:30
parent 928dee74b5
commit 20d979963a
4 changed files with 17 additions and 1 deletions

View File

@ -221,6 +221,14 @@ For this command to process the following conditions must be met:
item_type = TicketLinkedItem.Modules.TEAM
elif model_type == 'ticket_category':
from core.models.ticket.ticket_category import TicketCategory
model = TicketCategory
item_type = TicketLinkedItem.Modules.TICKET_CATEGORY
return tuple([
model,

View File

@ -43,6 +43,7 @@ class TicketLinkedItem(TenancyObject):
TEAM = 9, 'Team'
FEATURE_FLAG = 10, 'Feature Flag'
SOFTWARE_VERSION = 11, 'Software Version'
TICKET_CATEGORY = 12, 'Ticket Category'
is_global = None

View File

@ -7,6 +7,7 @@ from assistance.models.knowledge_base import KnowledgeBase
from config_management.models.groups import ConfigGroups
from core.models.ticket.ticket_category import TicketCategory
from core.serializers.ticket_linked_item import (
Ticket,
TicketLinkedItem,
@ -200,6 +201,12 @@ class ViewSet(ModelViewSet):
self.parent_model = SoftwareVersion
elif str(getattr(TicketLinkedItem.Modules, 'TICKET_CATEGORY').label).lower().replace(' ', '_') == self.kwargs['item_class']:
item_type = getattr(TicketLinkedItem.Modules, 'TICKET_CATEGORY').value
self.parent_model = TicketCategory
self.item_type = item_type