@bettsnation/paperclip-plugin-servicenow
v0.1.1
Published
Paperclip plugin for bidirectional ServiceNow incident sync — webhook intake and auto-resolve
Readme
@bettsnation/paperclip-plugin-servicenow
Paperclip plugin for bidirectional ServiceNow incident sync.
Inbound (SN → Paperclip)
- SN Business Rule fires webhook on incident creation
- Plugin creates Paperclip issue assigned to target agent
- Sets correlation_id on SN incident for back-reference
Outbound (Paperclip → SN)
- Issue completed → auto-resolve SN incident
- Issue status changes → SN work notes
- Agent comments → SN work notes
Install
npm install @bettsnation/paperclip-plugin-servicenowOr: Instance Settings → Plugins → Install Plugin → @bettsnation/paperclip-plugin-servicenow
Configuration
| Setting | Required | Description |
|---------|----------|-------------|
| snInstanceUrl | Yes | e.g. https://dev199497.service-now.com |
| snUsernameRef | Yes | Secret ref for SN username |
| snPasswordRef | Yes | Secret ref for SN password |
| snWebhookSecretRef | Yes | Secret ref for inbound webhook verification |
| targetCompanyId | Yes | Paperclip company for new issues |
| targetAgentId | Yes | Agent to assign new issues to |
| targetProjectId | Yes | Project for new issues |
| autoResolve | No | Auto-resolve SN incidents (default: true) |
| syncWorkNotes | No | Sync comments to SN (default: true) |
SN Business Rule
Create on incident table, after insert:
(function executeRule(current, previous) {
var rm = new sn_ws.RESTMessageV2();
rm.setEndpoint('<PLUGIN_WEBHOOK_URL>');
rm.setHttpMethod('POST');
rm.setRequestHeader('Content-Type', 'application/json');
rm.setRequestHeader('X-SN-Webhook-Secret', gs.getProperty('x_pc.webhook_secret'));
rm.setRequestBody(JSON.stringify({
number: current.getValue('number'),
sys_id: current.getValue('sys_id'),
short_description: current.getValue('short_description'),
description: current.getValue('description'),
priority: current.getValue('priority'),
caller_id: current.getDisplayValue('caller_id'),
assignment_group: current.getDisplayValue('assignment_group'),
category: current.getValue('category'),
subcategory: current.getValue('subcategory')
}));
rm.executeAsync();
})(current, previous);License
MIT
