Auto merge & Auto close alerting tool tickets

Auto merge & Auto close alerting tool tickets


In large IT environments, alerting tools like
Dynatrace, SolarWinds, OpManager etc play a critical role in proactively detecting issues. But when each alert ends up creating a new ticket in ServiceDesk Plus (SDP), your help desk can quickly get overwhelmed — especially when the same issue keeps firing repeated alerts.

(A ticket gets created either through alert emails sent to the configured SDP mailbox or via webhook-based API calls)

To help teams manage this better, we’ve built a custom function-based solution that works like magic:

Auto-Merge:  

When an alert fires repeatedly (e.g., “Machine XYZ is down” or “CPU usage crossed 80%”), our script detects that the alert is for the same device, and auto-merges the newly created request into the existing open ticket in SDP.

Auto-Close:  

Once the recovery email is received (e.g., “Machine XYZ is up” or “CPU usage is normal”), the same open ticket is automatically updated and closed based on the defined conditions.

To auto-close tickets, the script depends on clear co-relational keywords present in the subject line between the trigger and recovery alerts.
These directional keyword pairs help the script recognize that the problem has been resolved.

Examples of matched keyword pairs:

  • DownUp

  • OpenResolved

  • CriticalNormal

  • High CPU UsageCPU Usage Normal

  • Memory Usage High → Memory Usage Normal

  • Connection lost → Connection restored

  • Service unavailable → Service restored


⚠️ Limitation: No Matching Keywords = No Auto-Close  

Steps to configure:

1. Download the attached files
2. Open merge_similar_alerting_tool_tickets.txt file and copy the content
3. Go to SDP Admin --> Request custom function --> New custom function and create the custom function as per the screenshot



4. Open close_alerting_tool_ticket.txt and copy the content
5. Go to SDP Admin --> Request custom function --> New custom function and create the custom function as per the screenshot



Creating the custom functions is done. Time to create custom triggers
Go to SDP Admin --> Request custom trigger --> New custom trigger and custom triggers (2 custom triggers) as per the screenshots





                  New to ADSelfService Plus?

                    • Related Articles

                    • Script: Auto merge tickets of similar subject and auto closes the ticket--> Used V1 API dont use

                      Use case:   Too many alerts for the same reason from a machine keeps generating multiple tickets in SDP MSP.  You can use the below script to auto-merge the requests and auto close the ticket. What does this script do ? The Merged tickets description ...
                    • Script to Auto merge requests with exact same subject

                      Use case: Too many alerts for the same reason from a machine keeps generating multiple tickets in SDP MSP. You can use the below script to auto-merge the requests in the application. The Merged tickets description will be added as a note to the ...
                    • Auto-Merge Similar Tickets & Auto-Close Based on Keyword

                      Objective: Implement an automated mechanism in the ServiceDesk Plus to improve ticket management efficiency by: Automatically merging similar requests that share the same subject. Automatically closing tickets when the subject contains the keyword ...
                    • Script to Auto close Request when the status is Resolved for a particular number of days

                      For version 11 and above: -> In version 11, we only have the option to set the request Auto-close for a max of 10 days -> The below script will help you to extend the auto-closure time Execution steps: 1. Go to Reports--> New Query Report and run the ...
                    • Change Auto closure

                      This will be helpful in auto closing change request after X days it is in review stage. This use case is more suitable in environments where ONLY Requesters (customers) are the Change Reviewers and they want the Change to be closed if no review is ...