I can´t make working Custom Trigger

I can´t make working Custom Trigger

Hello.

I'm trying to make working a custom trigger.
I want to save the id of the request into a mysql server when the request status change to Resolved.

The script is in python (3.5.2) and this is my code,

  1. import pymysql.cursors
  2. import sys

  3. # Connect to the database
  4. connection = pymysql.connect(host='192.168.1.120',
  5.                              user='root',
  6.                              password='root',
  7.                              db='idsdb',
  8.                              cursorclass=pymysql.cursors.DictCursor)

  9. try:
  10.     with connection.cursor() as cursor:
  11.         # Create a new record
  12.         sql = "INSERT INTO `datos` (`id`) VALUES (%s)"
  13.         cursor.execute(sql, (str(sys.argv[1])))

  14.     # connection is not autocommit by default. So you must commit to save
  15.     # your changes.
  16.     connection.commit()

  17. finally:
  18.     connection.close()
When I execute the script form the cmd of windows like this "python sos.py 2333", the data is inserted.

But with the Custom Trigger dosn´t work.

my script is in the next path "C:\ManageEngine\ServiceDesk\integration\custom_scripts\sos.py"

and this is my custom trigger configuration

What i´m doing wrong??



      • Topic Participants

      • omar

                  New to ADSelfService Plus?