Salesforce integration with OpsGenie
Asked by Yatish Madhav:

Hi all

I have gone through this <https://support.atlassian.com/opsgenie/docs/integrate-opsgenie-with-salesforce-service-cloud/> for an SFDC integration.

For the point stating "When the case's state is changed to **Working** in Salesforce Service Cloud, the corresponding alert is acknowledged in Opsgenie." - is there a way to customize that? I.e. the SFDC system has been used for years with specific Statuses ... but Working has not been one of them.

How can we customize the integration so we can define our status or set of statuses to acknoledge the alert?

Thank you  
Yatish


Answers:
author: Nick H
body: Hi [@Yatish Madhav](/t5/user/viewprofilepage/user-id/3279728) ,

By default the integration is configured to ack the alert when the "Working" status is sent from SFDC \>\> Opsgenie.

If you are subscribed to Opsgenie's Standard or Enterprise plan, you can edit what status, or actions, acknowledge an alert under the integration's Advanced tab \>\> Acknowledge Alert action:

![sfdc1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/150567i6B093C1F824837A5/image-size/large?v=v2&px=999 "sfdc1.jpg")![sfdc2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/150568i5486C38A3D5BE536/image-size/large?v=v2&px=999 "sfdc2.jpg")

Here is where you can substitute your instances statuses, add other conditions, etc. - in order for the integration to ack an alert by a received SFDC request.

Hope this helps! Let us know if you have any additional questions, issues, etc.

comments: author: Yatish Madhav
body: Thanks for this, Nick.

I have tried that but it did not seem to have worked unless I am missing something else.

I set check for the Status = Investigating for testing for Ack-ing the alert and Status = Closed for closing the alert ... but it does not seem to be happening to the Alert.

Please advise?  
Thank you


author: Nick H
body: Is the Investigating SFDC request making it to the Acknowledge action?

Can you check the logs of that request to see how Opsgenie is receiving the request, and what action it's trying to execute?

It's tough to advise without seeing the alert, reviewing the logs, etc. If you can share any screenshots of the logs, as well your current configuration, I might be able to advise from there.


author: Yatish Madhav
body: Hi

So my rule for **Ignore** is

*Priority not equals 4 Minor Impact*

So my rule for **Close alert** is

*Priority equals 4 Minor Impact*

So my rule for **Close alert** is

*isClosed equals true*

So my rule for **Ack alert** is

*Status equals Investigating*

So my rule for **Add note** is

*Match all alert (with a test note)*

For all of them Alias is {{alias}}

Yes the Investigating case is pulled through under the activity of an existing alert as "*Alert is received with same alias. Message: "Salesforce event: Case with number 20151195 created with status : "Investigating"". Count is increased to 6*"

**See logs here** - it looks like :

**create**

![create.png](https://community.atlassian.com/t5/image/serverpage/image-id/151525iC2657775800530C0/image-size/large?v=v2&px=999 "create.png")

**ack**

![ack.png](https://community.atlassian.com/t5/image/serverpage/image-id/151526iF3EED81C8E56DC79/image-size/large?v=v2&px=999 "ack.png")

**close**

![closed.png](https://community.atlassian.com/t5/image/serverpage/image-id/151527iBA244287F6C2C936/image-size/large?v=v2&px=999 "closed.png")

**ack and close actions**

![ack and close actions.png](https://community.atlassian.com/t5/image/serverpage/image-id/151529iF6FCAE1E55E1EE15/image-size/large?v=v2&px=999 "ack and close actions.png")

It seems to be quite extensive these logs ... Please let me know

Thanks in advance


author: Nick H
body: It looks like those logs indicate that the requests are being [deduplicated](https://support.atlassian.com/opsgenie/docs/what-is-alert-de-duplication/) - which occurs when the alias of an alert matches the alias of an open existing Opsgenie alert. The other actions such as Close, Ack and Add Note are also dependent on this field.

But what seems to be happening is the requests are matching your Create Alert action. The integration's actions will be reviewed by Opsgenie from top \>\> down (Ignore \>\> Create \>\> Close \>\> Ack \>\> Add Note). When Opsgenie finds a matching filter / conditions, it will use that action.

You mentioned your Create Alert action filter is: *Priority equals 4 Minor Impact.*

You will most likely need to add another condition(s) that does NOT match on the close requests being received. Maybe something like this:

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

Hope that helps!


author: Yatish Madhav
body: Super! Thanks for the guidance. That has resolved it for me for the Close and Ack actions ...

The only one left is the Note action ... I currently have it for match all alerts ... but it does not seem to add the test note in the action - what from the Salesforce side would trigger the Add Note action for all alert matches?


author: Nick H
body: "*W* *hat from the Salesforce side would trigger the Add Note action for all alert matches?*"

To be honest, I'm not entirely sure. By default when adding a new SFDC integration, there isn't an Add Note action added by default. I also don't have an instance to test.

Without seeing how these requests might differ from others (like create, close, etc.), it'd be tough to provide suggestions. This would realistically depend on what is sent in the payload by SFDC \>\> OG. You could review these logs, and check what might differ - then adjust your other actions' filters so they do not trigger when a note is added, and can then match on the "catch-all" Add Note action that is set to Match All.

I'd suggest testing on your end, and reviewing the payload / request if received by Opsgenie when a note is added on the SFDC side. Then comparing it to other requests received. If no log or request is received by Opsgenie when a note is added on the SFDC side, then that would indicate these are not being received by Opsgenie, and some configuration would need to be done in SFDC to send to Opsgenie.

Hope this helps! Let us know if you have any other questions.


author: Madeleine Glover
body: A very useful thread. I've recently had the same issue and was searching for the answers for 2 weeks. Finally found this thread...it should be saved somewhere as a step-by-step guide. Anyway, I'm lucky to find a way to implement salesforce and email integration in my business. I've tried many times to find software that would be beneficial to my business and finally found a soft at revenuegrid. You can check their [salesforce inbox pricing](https://revenuegrid.com/pricing/) as they have different plans for the needs of the businesses.


Tags: integration

salesforce