Script to send notification to users on upcoming contracts

Script to send notification to users on upcoming contracts

Please follow the below link to setup python on the server


Steps to configure

1.  Extract the attached zip file in <Home>/integration/custom_scripts
2.  Update configuration.json with your outgoing mail server details, application URL, and Technician Key. You can ignore this step if there is already a configuration.json in place.
3.  Uncomment "send_to" variable in contract_active_notification.py file and configure "send_to" list (Can be done similarly to add CC if needed by uncommenting sent_cc). 
4. Create a query report with the below query and save it

      select ac.contractname, acd.org_name, ac.startdate, ac.expirydate from accountcontract ac inner join accountdefinition acd on ac.accountid=acd.org_id where ac.startdate=<from_today>  and ac.isactivecontract=true

      The above query will only include Contract Name, Account Name, Start Date, and Expiry Date. Fields can be added in select query based on requirements.

5. Under Admin >> Custom Schedule >> Create a custom schedule and configure "contract_active_notification.py" python script to be executed at 1 AM every day and pass the above query report as an argument.




                  New to ADSelfService Plus?

                    • Related Articles

                    • How to send custom email notifications for a request_NOT IN USE

                      This sample python script is used for sending custom notifications from ServiceDesk Plus MSP when a criteria is met.  You all know that ServiceDesk Plus MSP has notification rules and customisable templates to notify requesters, technicians, and ...
                    • Script to send notifications when a unknown request is raised

                      Use case The script will send email notifications to the address configured inside the script whenever a request is created under unknown requests.  This notification will be sent to Admin Email Pre-requisite - Python should be installed in the ...
                    • Query to retrieve the active and expired CPH contracts details

                      Tested in: 14620, 14610 and 14306 Query 1: To return the Active CPH contracts details: select ad.org_name "Account", ad.org_name "Account", sp.serviceplanname "Service Plan", ac.CONTRACTNO "Contract No", longtodate(ac.startdate) "Contract Start ...
                    • How to send custom email notifications from a request with a configurable XML file.

                      This sample python script is used for sending custom notifications from ServiceDesk Plus when a criteria  is met.You all know that ServiceDesk Plus has notification rules and customizable templates to notify requesters, technicians, and other stake ...
                    • How to auto-create request for contract expiry.

                      This post describes the use of a python script to auto-create requests for contract expiry using Custom Schedules. Use case: If the contract going to expire in next 7 days, we can create a ticket with the details for the contract in ServiceDesk Plus, ...