Added debugging for ticket generation

This commit is contained in:
2024-12-04 21:58:51 -05:00
parent 286112aa81
commit 49ca50412a

View File

@ -101,6 +101,10 @@ class SystemHealthMonitor:
"type": issue_type
}
# Debug: Log the ticket payload being sent
print("Attempting to create ticket with payload:")
print(json.dumps(ticket_payload, indent=4))
# Attempt to create the ticket via the API
try:
response = requests.post(
@ -108,6 +112,11 @@ class SystemHealthMonitor:
json=ticket_payload,
headers={'Content-Type': 'application/json'}
)
# Debug: Log the response from the server
print(f"Response status code: {response.status_code}")
print(f"Response body: {response.text}")
if response.status_code in [200, 201]:
print(f"Ticket created successfully: {ticket_title}")
else: