Skip to content

Commit

Permalink
fixing edge condition of creating ticket in thread without a ticket id
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Philion committed Sep 9, 2024
1 parent 47056c3 commit 9e0dcbe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cog_tickets.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ async def create_new_ticket(self, ctx: discord.ApplicationContext, title:str):
message = Message(from_addr=user.mail, subject=title, to=ctx.channel.name)
message.set_note(text)

ticket: Ticket = None
ticket_id = self.bot.parse_thread_title(channel_name)
if ticket_id:
# check if it's an epic
Expand All @@ -410,6 +411,8 @@ async def create_new_ticket(self, ctx: discord.ApplicationContext, title:str):
ticket = self.redmine.ticket_mgr.create(user, message, parent_issue_id=ticket_id)
else:
ticket = self.redmine.ticket_mgr.create(user, message)
else:
ticket = self.redmine.ticket_mgr.create(user, message)

if ticket:
# ticket created, set tracker
Expand Down

0 comments on commit 9e0dcbe

Please sign in to comment.