[otrs] 'Ticket Commands'

2,622 views
Skip to first unread message

haynes...@accenture.com

unread,
Aug 29, 2013, 4:21:02 AM8/29/13
to ot...@otrs.org

Hi,

                                                                                                                                        

What are the valid values possible in 'Ticket Commands' while creating a job in ‘Generic Agent’. Can we run bash scripts using this feature?

I was looking to run some custom scripts while closing a ticket. Is this possible? Your help is appreciated.

 

regards,

Haynes Davis

 



This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited.

Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

______________________________________________________________________________________

www.accenture.com

Renee B

unread,
Aug 29, 2013, 4:33:21 AM8/29/13
to ot...@otrs.org
You can run any command line command. So your cmd could look like
"/usr/bin/bash /path/to/your_script.sh".

- Renée

On 29.08.2013 10:21, haynes...@accenture.com wrote:
> Hi,
>
> What are the valid values possible in 'Ticket Commands' while creating a job in 'Generic Agent'. Can we run bash scripts using this feature?
> I was looking to run some custom scripts while closing a ticket. Is this possible? Your help is appreciated.
>
> regards,
> Haynes Davis

--
Perl / OTRS development: http://perl-services.de
OTRS AddOn repository: http://opar.perl-services.de

---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

Susan Dittmar

unread,
Aug 29, 2013, 5:27:16 AM8/29/13
to User questions and discussions about OTRS.
I guess you misunderstood the question, Renee. If I read the question correctly,
it's meant as "can I have GenericAgent perform a bash script on the ticket?".

Haynes, I can't give an answer to the rephrased problem as above.

If I misread and it's just the question of executing the GenericAgent from a
bash script, that's easy. On my very old install of OTRS (so the commands may
have different name now) I copied the GenericAgent.pm to a specialized version
only run from bash from time to time (as opposed to every 20 minutes via cron,
as the standard GenericAgent is). I called it GenericAgentPurgeOld.pm (remember
to change the package directive in the perl module accordingly). Then I call the
GenericAgent with this module via

/opt/otrs/bin/GenericAgent.pl -c 'Kernel::Config::GenericAgentPurgeOld' -d 1

If that does not answer your question, could you elaborate a bit on what you
want to accomplish? What information does the bash script need to be told, and
when exactly should it be called? Will the script change the ticket, and will
there be anything else done with the same ticket afterwards?

Hope that helps,

Susan

Renee B schrieb:
> You can run any command line command. So your cmd could look like
> "/usr/bin/bash /path/to/your_script.sh".
>
> - Renée

> On 29.08.2013 10:21, haynes...@accenture.com wrote:
>>What are the valid values possible in 'Ticket Commands' while creating a job in 'Generic Agent'. Can we run bash scripts using this feature?
>>I was looking to run some custom scripts while closing a ticket. Is this possible? Your help is appreciated.

haynes...@accenture.com

unread,
Aug 29, 2013, 6:19:34 AM8/29/13
to S.Di...@eureca.de, ot...@otrs.org
Thanks Susan and Renee for the reply.

My actual need is to run a bash script on closing a ticket. It will not change the ticket. Sorry for the initial question being a little confusing.


Regards,
Haynes
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited.

Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

______________________________________________________________________________________

www.accenture.com

Renee B

unread,
Aug 29, 2013, 6:54:16 AM8/29/13
to ot...@otrs.org
On 29.08.2013 11:27, Susan Dittmar wrote:
> I guess you misunderstood the question, Renee. If I read the question
> correctly, it's meant as "can I have GenericAgent perform a bash
> script on the ticket?".

Yes, that's what I answered ;-)

If you create a new GenericAgent, there is a section called "Ticket
Commands". In the field "CMD" you can insert the script that should be
called when the GenericAgent runs and matches...

If you want to do it in Kernel/Config/GenericAgent.pm, you can do it
that way:

'move escalation ticket to experts and execute CMD' => {
# get all tickets with these properties
Queue => 'xyz',
Escalation => 1,
# new ticket properties
New => {
Queue => 'experts',
# your program (/path/to/your/program) will be executed like
# "/path/to/your/program $TicketNumber $TicketID" ARG[0] will
# be the ticket number and ARG[1] the ticket id
CMD => '/path/to/your/program',
},
},



--
Perl / OTRS development: http://perl-services.de
OTRS AddOn repository: http://opar.perl-services.de

Susan Dittmar

unread,
Aug 29, 2013, 7:13:47 AM8/29/13
to User questions and discussions about OTRS.
Renee B wrote:
> On 29.08.2013 11:27, Susan Dittmar wrote:
>>I guess you misunderstood the question, Renee. [...]
>
> Yes, that's what I answered ;-)

Ah, sorry, progress in OTRS again bit me in the posterior. I really hope I can
update our system someday soon, I *want* all those "new" features!!!

Susan
Reply all
Reply to author
Forward
0 new messages