Use Webhooks
Introduction since 3.3.50
Security Disclaimer
Please note that this feature sends potentially sensitive data in a JSON payload across to a user configured endpoint!
Please review if the data sent via this feature is appropriate for the URI endpoints configured. Only send data to websites/endpoints that you trust or authorise. Consider your Data Protection Regulations.
This feature allows JEMH to send incoming mail processing information as JSON payloads to a user configured URIs CSV list if the URI is validated by the instance’s Jira Allowlist and if the URI Syntax is correct.
- 1 Introduction since 3.3.50
- 1.1.1 Security Disclaimer
- 1.2 JSON Payload information
- 1.2.1 Interface definition
- 1.2.2 Included fields
- 1.2.3 JSON example
- 1.2.3.1 Successful Outcome
- 1.2.3.2 Unsuccessful Outcome
- 1.3 Requirements
- 1.3.1 Webhook Endpoint Requirements
- 1.3.2 Jira Allow List
- 1.3.3 URI Syntax
- 1.4 Setup Guide
- 1.5 Notifications > Webhooks Section
- 1.6 Tracking Webhook outcomes via Auditing report
JSON Payload information
Interface definition
Please visit our API javadoc page: http://ppl-docs.s3-website-us-east-1.amazonaws.com/JEMH/3.3.50/com/javahollic/jira/emh/api/export/beans/IJEMHInboundMailProcessingWebhook.html for the interface definition.
Included fields
processed successfully: true/false
email subject
email sender address
catchemail (if matched)
issue key(s)
audit event timestamp
audit record id
audit outcome (processed /forwarded/ rejected)
filter name
filter action
audit link to entry
audit hints
profileID
blacklisted
blacklistAction
JSON example
Processing outcomes such as Forward, Dropped, Successful etc… do not prevent the webhook call as the webhook is independent from the event listener.
Successful Outcome
{
"auditEntryLink": "http://localhost:8080/secure/admin/jemh/JEMHAuditing.jspa?reportId=111",
"emailSenderAddress": "customer@localhost",
"processedOutcome": "canHandle",
"catchEmailAddress": "changeme@thiswontwork.com",
"auditEventId": 111,
"processedSuccessfully": true,
"profileId": 1,
"createdIssueKeys":
[
"JSMIT-42"
],
"emailSubject": "test This is a starting email template, update as required",
"timestamp": "2021-08-24 16:44:54.397"
}
Unsuccessful Outcome
{
"auditEntryLink": "http://localhost:2990/jira/secure/admin/jemh/JEMHAuditing.jspa?reportId=20",
"auditEventId": 20,
"catchEmailAddress": "changeme@thiswontwork.com",
"emailSenderAddress": "mailer-daemon@googlemail.com",
"emailSubject": "This is a starting email template, update as required",
"filterAction": "drop",
"filterName": "Whitelisting/Blacklisting filter",
"filterReason": "Silently dropping (no forward) blacklisted email [type=Profile Blacklist/Whitelist, detail=Email Sender 'mailer-daemon@googlemail.com' was blacklisted due to clause: mailer-daemon@googlemail.com] : from [mailer-daemon@googlemail.com], subject: This is a starting email template, update as required, sent: Sun Jun 19 06:42:26 BST 2011 BlacklistHandling is DROP, returning 'drop' to delete the mail from the queue.",
"processedOutcome": "drop",
"processedSuccessfully": true,
"profileId": 20,
"timestamp": "2021-08-24 16:51:57.168"
}
Requirements
Webhook Endpoint Requirements
The Webhook must have the following attributes:
Able to consume a POST http request method
Able to parse JSON payload from a request
If response is successful return a response status code of 200
Returns a response with 10 seconds of the initial webhook call!
Jira Allow List
First Ensure that the URI Is validated on your Jira Allowlist via: System > Administrator > Allowlist. Learn about the Allowlist configuration here: https://confluence.atlassian.com/adminjiraserver/configuring-the-allowlist-1014667309.html .
URI Syntax
Ensure that your Webhook URI follows the URI Syntax as per: RFC 3986. For more information please visit: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax.
Setup Guide
1) Enable the Webhook
This feature is independent from the Issue Event listener and will continue posting webhooks unless the feature is disabled!
Open the Issue Event Configuration via JEMH > Notifications > Issue Events Section > Edit Icon (Pen Icon).
Enabled the Webhook Enabled checkbox.
2) Add the webhook in the Webhook URI CSV text area.
Add a URI which has been validated by your Jira instance’s Allowlist.
3) Ensure that the Webhook added is valid.
4) Validating the webhook is fired via Test Cases and Auditing.
Ensure that the webhook is successful as shown below [SUCCESSFUL].
If the URI in question Invalid please see
Notifications > Webhooks Section
Evaluating invalid webhooks
Hover over the invalid webhook lozenges to see further information on the cause of invalid webhook.
One of the following titles with the error reason will pop up:
URI Not allowed: Verify that the URI is valid for your Jiras Allowlist via Administration > Security > Allowlist see: Use Webhooks | Jira Allow List .
URI Invalid Syntax: Verify that the URIs provided follow the URI Syntax see: Use Webhooks | URI Syntax
Tracking Webhook outcomes via Auditing report
The result of URI webhook outcomes is tracked using Incoming Mail Auditing report. The report can be retrieved via:
Use Incoming Mail Auditing | Generate Support Zip SINCE 3.1.2
Or from the webhook itself (If auditing is enabled)
[FAILED] Report Outcome for Webhook
If the webhook outcome is [FAILED] in the affected Incoming Mail Audit Report review the failure message as shown below:
Failed due to Allowlist validation
Failed due to failed URI syntax validation
Failed due to general IO Exceptions. Commonly due to endpoint failing to response within 10 seconds as per Use Webhooks | Webhook Endpoint Requirements or endpoint connection closed early.