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

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

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

 I do also  have the ability to get at items in the payload via the dynamic fields feature i.e. {{_payload.build_status }}

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.


There's the 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.



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

hi, have you ever heard back from your engineering team regarding the feature request? 
I dont get how you add global policies/team routing rules. I dont seem to have the permission to setup such things, as I can only see my team in the teams view. or is there a way to add custom draggable fields (attributes)? or only as admin?

what is a "global integration"? I could use API integration but this wont work with Gitlab as the auth-token cannot be send via GET request in API v2 of Opsgenie... and I guess the fields wont macht.

why dont you just expose "object_attributes" (with a custom textfield for subfields or something) like you already do for "object_kind" "Filter> Match conditions". then your team does not have to add attributes and users can use ANY attribute?

"object_kind": "pipeline",
"id": 31,
"ref": "master",
"status": "success",

just need to check the status of a pipeline...

aka {{_payload.object_attributes.status}} as Filter

greetz and thx 

Suggest an answer

Log in or Sign up to answer
Site Admin
Community showcase
Published in Opsgenie

Leveraging Atlassian’s Opsgenie and AWS Cloudformation Registry to stay ahead of incidents

In the past, managing IT infrastructure was a hard job. It required a lot of manual effort and it was hard to keep track of all the necessary information (monitoring, scalability etc). Thankfully, as...

839 views 0 7
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