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

Is there a way to customize the Alert Filter for the gitlab integration

My use case is that I want to create an alert if a job event has failed. 
I do realize that the current functionality for Job Event isn't listed
https://docs.opsgenie.com/docs/gitlab-integration

But in the Advanced setting in the integration I'm able to create alert policy when the Object Kind is equal to build, likely due to the fact both merge request and job events have the key object_kind in the payload
https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#job-events
https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#merge-request-events

 I do also  have the ability to get at items in the payload via the dynamic fields feature i.e. {{_payload.build_status }} https://docs.opsgenie.com/docs/draggable-fields#using-raw-parameters-from-webhook-url-payload-and-headers


While I can get access to the items in the payload in the Value field in an alert filter,
I can't set in the initial field we're looking at initially, see the screenshot on what I mean.

Opsgenie_-_Integration.png


There's the API integration, https://docs.opsgenie.com/docs/api-integration, but it doesn't support dynamic fields from the payload, I do see an Extra Properties fields that I could set but it doesn't integrate easily as the current gitlab integration i.e. formatting the request and authorization.


Thoughts? 

 

1 answer

1 accepted

0 votes
Answer accepted

Hi Alberto, 

I hope this answer finds you well and you are having a great day.

To start off I will go ahead and submit a feature request to our engineering team for the functionality of adding that field as a draggable field to the GitLab integration so that you can then use the filtering within the create action. 

As a work-around though I could suggest that you utilize global policies/team routing rules depending upon how you have the integration current configured. For example, if this is a global integration you could set up that status to be pulled into the extra properties section of the alert and then you will be able to apply a filter condition based on that key-value pair via global policies, team policies, and team routing rules. 

For example in this first screenshot I setup the global policy to match for the failed build and assign a team to that alert. This would be possible with the integration being global (not assigned to a specific team) 

In the second screenshot, I am showing you how you could handle this on the alert routing rule portion if the integration is assigned to a team. Whenever the integration is assigned to a team and an alert is created via that integration the team's routing rules will be assessed. What this will do is essentially route the alert to nobody if the key value of build status failed is not in the alert. You could then set up a team notification policy to auto close those alerts that hit the team but are not routed anywhere. The final screenshot is what that would look like under the team that owns the integration. 

 Please let me know if there are any further questions. Thanks so much

This is a followup reply since it seems the screenshots I had created for you did not show. Opsgenie_-_Apache-ops1.jpgOpsgenie_-_Apache-ops12.jpgOpsgenie_-_Policies.jpg

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Opsgenie

Enhanced Incident Response from Opsgenie’s Mobile App

We’ve released a new version of the Opsgenie Mobile App that includes enhancements already introduced into the web app to empower a collaborative, transparent incident management process. To enjoy th...

163 views 0 2
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