> For the complete documentation index, see [llms.txt](https://docs.sharelogic.com/unifi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sharelogic.com/unifi/4.0/configure/how-to-guides/how-to-manually-close-a-bond.md).

# How to Manually Close a Bond

Some integrations will not have a Message that closes the Bond. In these situations, it is preferable to close any open Bonds manually from a business rule on the Target table, e.g. when an Incident is closed . The following business rule script will close all the Bonds for a given record:

```javascript
(function executeRule(current, previous /*null when async*/) {
  var bond;
 
  bond = new GlideRecord('x_snd_eb_bond');
  bond.addQuery('document', '=', current.sys_id);
  bond.addQuery('state', '!=', 'Closed');
  bond.query();
 
  while (bond.next()) {
    bond.state = 'Closed';
    bond.update();
  }
 
})(current, previous);
```
