Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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 Community Leader Nov 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

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 Community Leader Nov 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

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 Community Leader Nov 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
Site Admin
TAGS
Community showcase
Published in Jira Service Management

Why upgrade to Jira Service Management Premium?

We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan.  &nb...

209 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you