diff --git a/docs/cwa/scripts/email-unsynced-tickets.md b/docs/cwa/scripts/email-unsynced-tickets.md new file mode 100644 index 0000000000..44bdb732ee --- /dev/null +++ b/docs/cwa/scripts/email-unsynced-tickets.md @@ -0,0 +1,82 @@ +--- +id: '660fe635-61c8-438f-9b06-4ef6b3656530' +slug: /660fe635-61c8-438f-9b06-4ef6b3656530 +title: 'Send Email for each Unsync Tickets' +title_meta: 'Send Email for each Unsync Tickets' +keywords: ['email', 'ticket', 'sync', 'notification', 'automate'] +description: 'This document outlines a script that sends an email notification for each ticket that failed to sync with PSA in the past specified hours. It details requirements, global parameters, and system properties necessary for the script to function effectively.' +tags: ['email'] +draft: false +unlisted: false +--- + +## Summary + +The purpose of the script is to send an email notification for each ticket that failed to sync with PSA in the past **X** hours. **X** is the number of hours set for the Global Parameter `Threshold`. + +**Requirements:** + +1. Ticket Sync should be enabled in the CW Manage Plugin. +2. The System Property 'Unsynced_Ticket_Email_Address' **MUST be manually created**. The script will NOT function without this property. + +**Note:** + +- All locations and clients that are 'Ignored' within the CW Manage Plugin will NOT report unsynced tickets for those locations/clients. +- It will detect the tickets that were generated at least 30 minutes ago to avoid false positives. + + +## Sample Run + +It is a client script and should be scheduled to run once per **X** hours. **X** is the number of hours set for the script's Global Parameter `Threshold`. + +![Sample Run Image 1](../../../static/img/docs/eb434aae-87c4-4315-bf73-202a41ff3a96/image_6.webp) + +**Schedule this script to run every 2 hours in the dashboard.** +![Sample Run Image 2](../../../static/img/docs/eb434aae-87c4-4315-bf73-202a41ff3a96/image_7.webp) + +## Variables + +| Name | Description | +|--------|--------------------------------------------| +| Email | Email Address(es) to send the Email | +| Subject| Email Subject | +| Body | Email Content | + +### Global Parameters + +| Name | Default | Required | Description | +|-----------|---------|----------|---------------------------------------------------| +| Threshold | 2 | True | Number of past hours to check the unsynced tickets from. | + +### System Properties + +| Name | Example | Required | Description | +|--------------------------------|----------------------------------|----------|-----------------------------------------------------------------------------| +| Unsynced_Ticket_Email_Address | [example@example.com](mailto:example@example.com) | True | Address(es) to send the email. Multiple addresses should be separated by a semicolon (;). | + +**Examples:** + +- Single Email Address: +![Single Email Example](../../../static/img/docs/eb434aae-87c4-4315-bf73-202a41ff3a96/image_3.webp) +- Multiple Email Addresses: +![Multiple Email Example](../../../static/img/docs/eb434aae-87c4-4315-bf73-202a41ff3a96/image_4.webp) + +**Note:** The script will not create the system property. Hence, this system property should be created before scheduling/running the script. Otherwise, the script will not work. + +## Output + +- Email + +## Email + +**Subject:** 'Ticket Sync Failed - %subject%' + +**Body:** + +```PlainText +%body% +[Body message of the ticket that failed to sync to PSA] +``` + +**Sample Screenshot:** +![Sample Screenshot](../../../static/img/docs/eb434aae-87c4-4315-bf73-202a41ff3a96/image_8.webp) \ No newline at end of file diff --git a/static/img/docs/eb434aae-87c4-4315-bf73-202a41ff3a96/image_6.webp b/static/img/docs/eb434aae-87c4-4315-bf73-202a41ff3a96/image_6.webp new file mode 100644 index 0000000000..2c7d03c0b6 Binary files /dev/null and b/static/img/docs/eb434aae-87c4-4315-bf73-202a41ff3a96/image_6.webp differ diff --git a/static/img/docs/eb434aae-87c4-4315-bf73-202a41ff3a96/image_7.webp b/static/img/docs/eb434aae-87c4-4315-bf73-202a41ff3a96/image_7.webp new file mode 100644 index 0000000000..79909e16fe Binary files /dev/null and b/static/img/docs/eb434aae-87c4-4315-bf73-202a41ff3a96/image_7.webp differ diff --git a/static/img/docs/eb434aae-87c4-4315-bf73-202a41ff3a96/image_8.webp b/static/img/docs/eb434aae-87c4-4315-bf73-202a41ff3a96/image_8.webp new file mode 100644 index 0000000000..73ceaa5258 Binary files /dev/null and b/static/img/docs/eb434aae-87c4-4315-bf73-202a41ff3a96/image_8.webp differ