Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugin): create fallback ticket in case Jira fails #5415

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

whitdog47
Copy link
Contributor

Summary

This pull request introduces a fallback mechanism to handle scenarios where Jira ticket creation fails. The changes ensure that incidents and cases can still proceed with a ticket, even if the Jira integration encounters an error.

Key Changes

  1. Fallback Ticket Creation:

    • Added a new function create_fallback_ticket in src/dispatch/plugins/dispatch_jira/plugin.py to generate a fallback ticket with a specific resource type (jira-error-ticket) when Jira ticket creation fails.
  2. Incident and Case Ticket Creation:

    • Updated the create and create_case_ticket methods in JiraTicketPlugin to handle exceptions during Jira ticket creation. If an error occurs, the system now creates a fallback ticket using the core plugin.
  3. Incident Resource Flow:

    • Modified incident_create_resources in src/dispatch/incident/flows.py to check for the jira-error-ticket resource type, ensuring that the incident process continues even if the Jira ticket is not created.
  4. User Interface Enhancements:

    • Updated ResourcesTab.vue to display an error message when a Jira ticket is not created, guiding users to use the "Recreate Missing Resources" option.
      image
  5. Logging and Error Handling:

    • Enhanced logging to capture exceptions during ticket creation, providing more context for troubleshooting.

Files Changed

  • src/dispatch/incident/flows.py: Adjusted logic to handle fallback tickets.
  • src/dispatch/plugins/dispatch_jira/plugin.py: Implemented fallback ticket creation and error handling.
  • src/dispatch/static/dispatch/src/incident/ResourcesTab.vue: Updated UI to reflect ticket creation errors.
  • src/dispatch/ticket/flows.py: Ensured resource type is updated correctly.

@whitdog47 whitdog47 added bug Something isn't working techdebt labels Oct 31, 2024
@whitdog47 whitdog47 self-assigned this Oct 31, 2024
@whitdog47 whitdog47 marked this pull request as ready for review October 31, 2024 21:08
@whitdog47 whitdog47 changed the title Creating fallback in case Jira fails fix(plugin): create fallback ticket in case Jira fails Oct 31, 2024
@whitdog47 whitdog47 merged commit e8c424f into master Nov 4, 2024
8 checks passed
@whitdog47 whitdog47 deleted the bugfix/jira-fallback branch November 4, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working techdebt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants