Jenkins Integration trying to close alerts before opening them? "Discarding delayed incomingData"?
Asked by taylor.kirkpatrick:

Hello, I'm trying to set up Jenkins integration on a server of ours, but I'm seeing odd behavior in the logs and not seeing any alerts or notifications out of OpsGenie.  

![logs opsgenie.png](/t5/image/serverpage/image-id/137658i04E38EED6ECB7B12/image-size/large?v=v2&px=999 "logs opsgenie.png")

As far as I can tell, the Jenkins integration is telling OpsGenie to close an alert without ever actually creating it. All alert policies have been suspended, so nothing should be auto deleting or closing them.  

Reading through the docs on the integration and the Jenkins plugin, there doesn't seem to be a way to control what action should be taken on an alert. On the Jenkins side I'm trying this in both pipeline and freestyle jobs, same behavior on both.  

The only other issue similar to this one I found was <https://community.atlassian.com/t5/Opsgenie-questions/Opsgenie-delayed-incomingData/qaq-p/1648853> but it appears unrelated.   

I figured I would ask the community about this before opening a ticket. Has anyone seen similar behavior before?


Answers:
author: Nick H
body: Hi [@taylor.kirkpatrick](/t5/user/viewprofilepage/user-id/4337863) ,

That other post could be somewhat related, but not entirely sure without checking the logs. What I would suggest is reviewing the data being parsed in the payload of the Processed Log:

![jenkinscomm1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/137659i52F307A252702928/image-size/large?v=v2&px=999 "jenkinscomm1.jpg")

\^ There should be a dropdown to the right side of this log, then also drop down the Incoming Data + Parsed Data:

![jenkinscomm2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/137660i7E6A4D8EB959567B/image-size/large?v=v2&px=999 "jenkinscomm2.jpg")

Here you can check what data is being sent from Jenkins \>\> Opsgenie. Then you'll want to compare it with the integration's Create Alert action(s) - and what data needs to match in order for an alert to be created. The actions can be reviewed under an integration's Advanced tab:

![jenkinscomm3.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/137665i8DF5D9CF3D721FF9/image-size/large?v=v2&px=999 "jenkinscomm3.jpg")

![jenkindscomm4.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/137661i155C472FA229E0E6/image-size/large?v=v2&px=999 "jenkindscomm4.jpg")

Note this tab is only available for the Standard and Enterprise plans. By default the integration will have a few actions already defined.

The behavior you mentioned - "*As far as I can tell, the Jenkins integration is telling OpsGenie to close an alert without ever actually creating it*" - is most likely due to the filters of the Create Alert action(s) not matching with what's being sent from Jenkins \>\> Opsgenie.

This would explain why it appears the Close Alert actions are being reviewed. The actions of an integration will be reviewed from top \>\> down until Opsgenie finds a matching filter / set of conditions, then execute that action. First reviewing the Ignore actions, Create actions, etc.

The Create Alert actions are where you can also define what requests will create alerts such as both pipeline and freestyle jobs. I hope this helps troubleshoot your issue!

Please let us know if you have any additional questions, issues, etc.

comments: author: taylor.kirkpatrick
body: Thank you! I was running my tests in the main part of the build. It seems the Integration optimistically assumes the build is a success if it isn't running post build, and alerts aren't created by default on successful builds. Changing the advanced settings of my integration fixed the issue.


Tags: jenkins