Skip to content

Conversation

Eliesmbr
Copy link
Contributor

Summary

This PR adds support for automatic Jira ticket transitions when alerts are resolved, enabling workflows that automatically close tickets.

Changes

  • Added transition_to parameter to Jira provider's _notify() method
  • Implemented __get_available_transitions() to fetch available transitions for an issue
  • Implemented __transition_issue() to execute status transitions by name or ID
  • Added TRANSITION_ISSUES scope to provider scopes list
  • Added case-insensitive transition name matching
  • Added helpful error messages listing available transitions when invalid name is used
  • Added workflow documentation and examples

Use Case

Organizations using Keep for alerting often want Jira tickets to automatically reflect alert status. This PR enables:

  1. Creating a Jira ticket when an alert fires
  2. Automatically transitioning the ticket to "Done"/"Resolved" when the alert resolves

This reduces manual work and ensures Jira boards stay up-to-date with actual ticket status.

Example Usage

Workflow 1: Create ticket on alert

actions:
  - name: create-jira-ticket
    provider:
      type: jira
      with:
        board_name: ALERTS
        summary: "{{ alert.name }}"
        enrich_alert:
          - key: ticket_id
            value: results.issue.key

Workflow 2: Auto-close ticket when resolved

triggers:
  - type: alert
    cel: status == "resolved"
actions:
  - name: close-ticket
    provider:
      type: jira
      with:
        issue_id: "{{ alert.ticket_id }}"
        transition_to: Done

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

Screenshots

image image

Breaking Changes

None - this is a backward-compatible addition.

- Add transition_to parameter to Jira provider for automatic status changes
- Implement __get_available_transitions() to fetch available transitions
- Implement __transition_issue() to execute status transitions
- Add TRANSITION_ISSUES scope to provider scopes
- Support case-insensitive transition names
- Add helpful error messages when invalid transitions are used
- Add workflow examples for auto-creating and auto-closing tickets

This allows users to automatically close Jira tickets when Keep alerts
are resolved, reducing manual work and improving incident response workflow.
@vercel
Copy link

vercel bot commented Oct 15, 2025

@Eliesmbr is attempting to deploy a commit to the KeepHQ Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 15, 2025
@CLAassistant
Copy link

CLAassistant commented Oct 15, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Contributor

No linked issues found. Please add the corresponding issues in the pull request description.
Use GitHub automation to close the issue when a PR is merged

@dosubot dosubot bot added Feature A new feature Provider Providers related issues labels Oct 15, 2025
@vercel
Copy link

vercel bot commented Oct 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
keep Ignored Ignored Preview Oct 15, 2025 10:15am

@talboren talboren enabled auto-merge (squash) October 15, 2025 09:22
auto-merge was automatically disabled October 15, 2025 09:41

Head branch was pushed to by a user without write access

Copy link
Member

@talboren talboren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 15, 2025
@talboren talboren merged commit 0c87eb9 into keephq:main Oct 15, 2025
13 of 15 checks passed
@github-actions
Copy link
Contributor

🏆 Fantastic work @Eliesmbr! Your very first PR to keep has been merged! 🎉🥳

You've just taken your first step into open-source, and we couldn't be happier to have you onboard. 🙌
If you're feeling adventurous, why not dive into another issue and keep contributing? The community would love to see more from you! 🚀

For any support, feel free to reach out on the community: https://slack.keephq.dev. Happy coding! 👩‍💻👨‍💻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature A new feature lgtm This PR has been approved by a maintainer Provider Providers related issues size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants