Hello,
I want to call a python function with command line arguments after a ticket is created.
The command line argument should be the ticket ID.
" /var/test.py -c "ticket_id" "
Is that possible?
OTRS call python function after ticket creation
Moderator: crythias
-
- Znuny newbie
- Posts: 17
- Joined: 27 Feb 2020, 12:34
- Znuny Version: OTRS5
- Real Name: markus
Re: OTRS call python function after ticket creation
yes thats possible via the "Execute Ticket Commands" function in the Generic Agent
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
-
- Znuny newbie
- Posts: 17
- Joined: 27 Feb 2020, 12:34
- Znuny Version: OTRS5
- Real Name: markus
Re: OTRS call python function after ticket creation
And how would you pass the ticket id?
" /var/test.py -c { ???} "
is it necessary to pass the arguments or are they automaticly set to the end of the command?
" /var/test.py -c { ???} "
is it necessary to pass the arguments or are they automaticly set to the end of the command?
Re: OTRS call python function after ticket creation
the function will add two parameters to the command. The first parameter is the TicketID and the 2nd one is the full Ticket number.
You can try with this small shell script:
You can try with this small shell script:
Code: Select all
#!/bin/bash
echo $1";"$2 >> /tmp/tickets.txt
exit 0
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
-
- Znuny newbie
- Posts: 17
- Joined: 27 Feb 2020, 12:34
- Znuny Version: OTRS5
- Real Name: markus
Re: OTRS call python function after ticket creation
Thank you for your help.
But should i specify the path like this:
bash /opt/otrs/scripts/test.sh
or like that:
bash scripts/test.sh
But should i specify the path like this:
bash /opt/otrs/scripts/test.sh
or like that:
bash scripts/test.sh
Re: OTRS call python function after ticket creation
full path should be used
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
-
- Znuny newbie
- Posts: 17
- Joined: 27 Feb 2020, 12:34
- Znuny Version: OTRS5
- Real Name: markus
Re: OTRS call python function after ticket creation
Okay thank you very much for your help!