@ -56,6 +56,7 @@ class RequestTicketModelSerializer(
|
|||||||
'estimate',
|
'estimate',
|
||||||
'duration',
|
'duration',
|
||||||
'urgency',
|
'urgency',
|
||||||
|
'urgency_badge',
|
||||||
'impact',
|
'impact',
|
||||||
'priority',
|
'priority',
|
||||||
'external_ref',
|
'external_ref',
|
||||||
|
@ -568,6 +568,7 @@ class Ticket(
|
|||||||
'id',
|
'id',
|
||||||
'title',
|
'title',
|
||||||
'status_badge',
|
'status_badge',
|
||||||
|
'urgency_badge',
|
||||||
'opened_by',
|
'opened_by',
|
||||||
'organization',
|
'organization',
|
||||||
'created'
|
'created'
|
||||||
@ -930,6 +931,44 @@ class Ticket(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@property
|
||||||
|
def urgency_badge(self):
|
||||||
|
|
||||||
|
from core.classes.badge import Badge
|
||||||
|
|
||||||
|
text:str = '-'
|
||||||
|
|
||||||
|
if self.urgency:
|
||||||
|
|
||||||
|
if self.urgency == self.TicketUrgency.VERY_LOW:
|
||||||
|
|
||||||
|
text = 'Very Low'
|
||||||
|
|
||||||
|
elif self.urgency == self.TicketUrgency.LOW:
|
||||||
|
|
||||||
|
text = 'Low'
|
||||||
|
|
||||||
|
elif self.urgency == self.TicketUrgency.MEDIUM:
|
||||||
|
|
||||||
|
text = 'Medium'
|
||||||
|
|
||||||
|
elif self.urgency == self.TicketUrgency.HIGH:
|
||||||
|
|
||||||
|
text = 'High'
|
||||||
|
|
||||||
|
elif self.urgency == self.TicketUrgency.VERY_HIGH:
|
||||||
|
|
||||||
|
text = 'Very High'
|
||||||
|
|
||||||
|
|
||||||
|
return Badge(
|
||||||
|
icon_name = 'circle',
|
||||||
|
icon_style = f"status {text.lower().replace(' ', '-')}",
|
||||||
|
text = text,
|
||||||
|
text_style = '',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def ticketassigned(self, instance) -> bool:
|
def ticketassigned(self, instance) -> bool:
|
||||||
""" Check if the ticket has any assigned user(s)/team(s)"""
|
""" Check if the ticket has any assigned user(s)/team(s)"""
|
||||||
|
|
||||||
|
@ -107,6 +107,8 @@ class TicketModelSerializer(
|
|||||||
|
|
||||||
status_badge = BadgeField(label='Status')
|
status_badge = BadgeField(label='Status')
|
||||||
|
|
||||||
|
urgency_badge = BadgeField(label='Urgency')
|
||||||
|
|
||||||
organization = OrganizationField( required = True, write_only = True )
|
organization = OrganizationField( required = True, write_only = True )
|
||||||
|
|
||||||
|
|
||||||
@ -142,6 +144,7 @@ class TicketModelSerializer(
|
|||||||
'estimate',
|
'estimate',
|
||||||
'duration',
|
'duration',
|
||||||
'urgency',
|
'urgency',
|
||||||
|
'urgency_badge',
|
||||||
'impact',
|
'impact',
|
||||||
'priority',
|
'priority',
|
||||||
'external_ref',
|
'external_ref',
|
||||||
|
@ -59,6 +59,7 @@ class ChangeTicketModelSerializer(
|
|||||||
'estimate',
|
'estimate',
|
||||||
'duration',
|
'duration',
|
||||||
'urgency',
|
'urgency',
|
||||||
|
'urgency_badge',
|
||||||
'impact',
|
'impact',
|
||||||
'priority',
|
'priority',
|
||||||
'external_ref',
|
'external_ref',
|
||||||
|
@ -57,6 +57,7 @@ class IncidentTicketModelSerializer(
|
|||||||
'estimate',
|
'estimate',
|
||||||
'duration',
|
'duration',
|
||||||
'urgency',
|
'urgency',
|
||||||
|
'urgency_badge',
|
||||||
'impact',
|
'impact',
|
||||||
'priority',
|
'priority',
|
||||||
'external_ref',
|
'external_ref',
|
||||||
|
@ -58,6 +58,7 @@ class ProblemTicketModelSerializer(
|
|||||||
'estimate',
|
'estimate',
|
||||||
'duration',
|
'duration',
|
||||||
'urgency',
|
'urgency',
|
||||||
|
'urgency_badge',
|
||||||
'impact',
|
'impact',
|
||||||
'priority',
|
'priority',
|
||||||
'external_ref',
|
'external_ref',
|
||||||
|
@ -57,6 +57,7 @@ class ProjectTaskTicketModelSerializer(
|
|||||||
'estimate',
|
'estimate',
|
||||||
'duration',
|
'duration',
|
||||||
'urgency',
|
'urgency',
|
||||||
|
'urgency_badge',
|
||||||
'impact',
|
'impact',
|
||||||
'priority',
|
'priority',
|
||||||
'external_ref',
|
'external_ref',
|
||||||
|
Reference in New Issue
Block a user