Wajahat698 commited on
Commit
517529b
Β·
verified Β·
1 Parent(s): 5447477

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -335,12 +335,20 @@ def handle_event(event_data):
335
 
336
  # ── Step 2: Create a ticket if LLM decided escalation is needed ──────────
337
  if should_create_ticket:
338
- description = build_ticket_description(channel)
 
 
 
 
 
 
 
 
 
 
339
  ticket_id, board_used = create_ticket(description)
340
 
341
  if ticket_id:
342
- # Fetch requester info and store it so the close-webhook can use it
343
- name, email = get_slack_user_info(user_id)
344
  register_ticket(ticket_id, user_id, name, email, channel)
345
 
346
  send_slack(
 
335
 
336
  # ── Step 2: Create a ticket if LLM decided escalation is needed ──────────
337
  if should_create_ticket:
338
+ # Fetch requester info BEFORE creating the ticket so it appears inside CW
339
+ name, email = get_slack_user_info(user_id)
340
+
341
+ requester_header = (
342
+ f"--- Submitted via Slack Bot ---\n"
343
+ f"Name: {name}\n"
344
+ f"Email: {email}\n"
345
+ f"Slack ID: {user_id}\n"
346
+ f"--------------------------------\n\n"
347
+ )
348
+ description = requester_header + build_ticket_description(channel)
349
  ticket_id, board_used = create_ticket(description)
350
 
351
  if ticket_id:
 
 
352
  register_ticket(ticket_id, user_id, name, email, channel)
353
 
354
  send_slack(