Create Opsgenie alerts for JSM tickets created during weekend
Currently the option to directly specify time frames for only Saturdays and Sundays isn't available in the standard Opsgenie interface, you might need to approach this requirement with a combination of Jira Service Management automations and Opsgenie alert rules based on custom tags or fields that indicate the ticket was created on a weekend.
1. Use JSM Automations to Tag Weekend Tickets
You can create an automation rule in JSM that adds a specific label or updates a custom field on tickets created during the weekend. This label or field can then be used to control the alert creation in Opsgenie.
Steps to set up automation in JSM:
- Go to your JSM project.
- Navigate to Project settings > Automation.
- Click Create rule.
- For the trigger, select Issue created.
- Add a new condition to check if the day of creation is Saturday or Sunday. This might require JQL like:
created > startOfWeek(-26h) AND created <= startOfWeek(1d) ORDER BY created DESC
- For the action, choose Edit issue and set a label like "weekend" or modify a custom field to a value like "WeekendTicket".
2. Configure Opsgenie to Use the Label/Field
Once you have your JSM tickets being tagged or field-updated based on the creation day, configure Opsgenie to only create alerts when these tags or fields are present.
Opsgenie Integration settings:
- Navigate to Integrations and select your JSM integration.
- Edit the incoming automation rule
- Modify the integration filters or alert creation rules to include conditions that check for the "WeekendTicket" label.
- Rule Type: Select "Create alert" as the rule type.
- Add Conditions:
- Select “Match all conditions below”.
- Under conditions, set:
- Labels: Choose the condition where labels “contains” and enter "WeekendTicket".
This method leverages the flexibility of JSM automations and the specificity of Opsgenie alert rules to manage when alerts should be created, bypassing the need for specific time-frame settings directly within Opsgenie for weekend coverage.
Additional Reference:
JQL for After Hours and Weekends