ewsterrenburg / python-otrs

Pythonic interface to OTRS SOAP API
GNU General Public License v3.0
47 stars 27 forks source link

Creating a ticket where the first article is a outbound email to someone #18

Closed flexd closed 4 years ago

flexd commented 8 years ago

Is this possible? Looking through the TicketCreate code at the OTRS repo https://github.com/OTRS/otrs/blob/dcb3fdc98336baa30ff614d75d2069dcdba2a73f/Kernel/GenericInterface/Operation/Ticket/TicketCreate.pm it looks like the To field is set to the queue regardless of what you do https://github.com/OTRS/otrs/blob/dcb3fdc98336baa30ff614d75d2069dcdba2a73f/Kernel/GenericInterface/Operation/Ticket/TicketCreate.pm#L1296

I would like to create a ticket in OTRS and send a email to someone at the same time, via the API

I can see some hints on the internet that this is possible, but I have not figured it out yet.

ewsterrenburg commented 8 years ago

As far as I know, the first article of a new ticket is just "sent" to the queue. However, I do not know OTRS in depth and my perl is rusty (read non-existent....), so I wouldn't know how the webservice could handle this by itself.

I do think it would be possible to configure this in OTRS itself (using event-based notifications?). I'm no expert on this, so perhaps you can better ask about this on a OTRS related forum or mailing list...

mjducharme commented 8 years ago

Yes event based notifications can work for this. You will just need to be careful with filters so that it didn't also send such things for email tickets.

The other way it could be handled is with an auto response that quoted the entire original post, which might be easier.

However this should not have any bearing on Python-OTRS since it is more of a design philosophy of the ticket connector in OTRS itself. AFAIK they mainly designed it so customers could have a custom interface to create and view tickets in OTRS, branded to fit in with the rest of the corporate website rather than a jarring switch to the OTRS theme. When the customer submits a ticket in this instance, they already know about it, and therefore do not need it emailed to them.

One thing you could try is experiment with changing the article type for the initial article created by Python-OTRS. The default is web-request, but you could try setting the type to email-external. This may trigger OTRS to send it as an email, but I am not sure if it will work. It may just make the initial article that type but not actually send an email, which would be a bit useless for your purposes.

flexd commented 8 years ago

As you can see in the code for OTRS, it does not call any code that would send an email, regardless of the initial article type.

I emailed the mailing list back, and was told it's currently not possible but there is a pull-request https://github.com/OTRS/otrs/pull/815

Once that is merged it will be possible to send emails via the API.

ewsterrenburg commented 8 years ago

@flexd I noticed your email on the mailinglist and the replies. When this functionality is added to OTRS itself, the operation will also be added to python-otrs. Will keep this issue open.

ewsterrenburg commented 4 years ago

Developments in OTRS seem to have bled to death. Will close now.