Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Only create Opsgenie alert from Jira Service Desk issue during certain times

Chris Haworth November 11, 2020

We have been using opsgenie and are now implementing Jira Service Desk. I would like to create an Opsgenie alert for any new service desk issue created ONLY during off work hours.

example: customer opens issue at 1am, I want to create an alert in opsgenie.  Customer opens issue at 1pm, no alert created in opsgenie.

Currently I have all service desk issues creating alerts and only routing alerts during off hours.. but that still leaves 'clean up' work of closing all opsgenie alerts that were created during the day but not routed.

 

 

3 answers

1 accepted

1 vote
Answer accepted
Jack Brickey
Community Champion
November 11, 2020

and yet a 3rd way...

If you are using the JSD webhook you can simply set the jql condition to meet your needs. For example, let's define Afterhours as 5pm - 7:59am then the jql would be...

project = abc and (createddate >= startofday() and createddate < startofday(+8h)) OR (createddate >= startofday(+17h) and createddate < startofday())

I think i have the syntax correct but definitely check me on that. Decoding this...

  • createddate >= startofday() and createddate < startofday(+8h) --> midnight to 7:59am
  • createddate >= startofday(+17h) and createddate < startofday() --> 5pm to midnight
Chris Haworth November 11, 2020

Yes, we are using the JSD webhook.  This is really good.. I'm new to jql so took me a bit to implement.. learned syntax needs to include quotes

ex:  startofday("+17") 

next up is to figure out how to carve out based on day of week.. as the above wont send alerts if customers submit issues on Sat or Sun 8am-5p :)

Jack Brickey
Community Champion
November 12, 2020

yes, you will need to play w/ the various 'day' options to get there. Likely using startofweek() function to add in the weekend component to your definitions of after hours. This would be a good how to article...if I only had some free time. :-(

Like Chris Haworth likes this
1 vote
Kian Stack Mumo Systems
Community Champion
November 11, 2020

Chris,

I'd play around with creating an SLA which breaches immediately when "Off hours" hit. Then, you can write a JQL which will pick up any tickets which have been breached AND created within the last couple of minutes. That way you'll only get tickets which were created after hours.

 

Does that make sense?

Thanks,

Kian

0 votes
Ismael Jimoh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 11, 2020

Hi @Chris Haworth ,

You could consider doing with the automation for JIRA and in the if condition you can check for created between endofday(some hours) and startofday(somehours). The problem here is JIRA does not have true out of office calendars that can then trigger such an event as you want.

  • when issue created,
  • If : Issue matches: ((Created >= startofday() and created < startofday(+7h)) OR (Created >= startofday(19h) and created < endofday())
  • Then: Trigger alert to mention your user JIRA user associated with Opsgenie. 

Please note that this is just a workaround and does not factor in the Opsgenie add-on being used directly here.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events