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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,646,250
Community Members
 
Community Events
196
Community Groups

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? 

 

2 answers

1 accepted

0 votes
Answer accepted
Chris DeGidio
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 08, 2020

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

Chris DeGidio
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 08, 2020

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",
"object_attributes":
{
"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 

Like # people like this

Do you found any way to do it? I have the same problem

Same here :/

And the solution is super quick to implement. 

hi, have you ever heard back from your engineering team regarding the feature request? 

tks,

Emiliano

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events