Skip to content

Commit

Permalink
feat(core): Link Team to ticket
Browse files Browse the repository at this point in the history
ref: #274 #426
  • Loading branch information
jon-nfc committed Dec 19, 2024
1 parent 5c324af commit 88b79bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/core/lib/slash_commands/linked_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ def command_linked_model(self, match) -> str:

item_type = TicketLinkedItem.Modules.SOFTWARE

elif model_type == 'team':

from access.models import Team

model = Team

item_type = TicketLinkedItem.Modules.TEAM

else:

return str(match.string[match.start():match.end()])
Expand Down
5 changes: 5 additions & 0 deletions app/core/models/ticket/ticket_linked_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Modules(models.IntegerChoices):

KB = 7, 'Knowledge Base Article'
ORGANIZATION = 8, 'Organization'
TEAM = 9, 'Team'

is_global = None

Expand Down Expand Up @@ -136,6 +137,10 @@ def __str__(self) -> str:

item_type = 'software'

elif self.item_type == TicketLinkedItem.Modules.TEAM:

item_type = 'team'

if item_type:

return f'${item_type}-{int(self.item)}'
Expand Down

0 comments on commit 88b79bf

Please sign in to comment.