---
title: "Trigger code when an association is unlinked"
canonical: "https://support.appfire.com/space/477986818/2560920173/Trigger%20code%20when%20an%20association%20is%20unlinked"
format: markdown
---
The app lets you subscribe to Appfire’s Salesforce package events to invoke custom code after a specific action occurs. To be notified about the **unlink** action, create a new Apex class that implements the `SfjcActionEventListener` interface. 

##### MyListener

```java
global class MyListener implements JCFS.SfjcActionEventListener {
    public void onEvent(String eventName, Map<String,Object> data) {
       System.debug('Hello world!');
       System.debug(eventName);
       System.debug(data);
    }
}
```

The **unlink** event contains the following fields:

- `son` - string, for example, Case
- `soid` - string - the Case Id
- `jiraIssueId` - string - the key of the Jira work item that was unlinked

In this example, `MyListener` listens for an **unlink** event between Jira and a Salesforce object. When the event is detected, a debug message is sent to the execution log.

To use this feature, you must grant the `WebhookRestResource` Apex class access to the integration user profile.

1. Go to **Setup** and enter `Apex Classes` in the **Quick Find** field.
2. Select **WebhookRestResource** > **Security**.
  
3. Add the integration user profile to the *Enabled Profiles*.