generic agent - pass arguments to a script / or write data into customer database automatically

Moderator: crythias

Post Reply
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

generic agent - pass arguments to a script / or write data into customer database automatically

Post by PhyrePhoX »

Hi,

is it possible to pass arguments like customer id / login or contract number via generic agent to a script?
Ticket commands / CMD only allows ticket number and ticket id.
Do i really have to write a custom module for this?

Background to my question:
- i import daily a customer database directly into a local postgres (which otrs is using read only)
- some customers allow to be sent "spam" via Opt-In
- this opt-in is noted in a field in the customer DB
- upon ticket creation, a dynamic field is filled with this Opt-In
- when a ticket is closed i have a generic agent running that executes on ticket state change AND if the optin is set and sets another special dynamic field
- a notification was created that checks for change of that special dynamic field -> if field is changed, send an automated email to customer
This works so far - however, i dont want to send the customer a mail for EVERY Mail that is closed on his behalf. I want to implement a "cool down"
- so my idea was to use the generic agent from above to tell a script of mine that contract XYZ is now in cooldown (for example i could disable the optin field, along with a timestamp and then have a cronjob that checks if timer is reached)
(Basically, we want to automatically send a link to a survey after a customer ticket is closed, but only when customer didnt receive a mail within last 7 days)

Alternatively - i could mount the customer database also as r/w (or at least that opt-in field). But what i havent found out yet is, how i can write from OTRS into that field (in an automated fashion - i dont want to use the customer admin dialogue)

thanks in advance!
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
root
Administrator
Posts: 3960
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: generic agent - pass arguments to a script / or write data into customer database automatically

Post by root »

Hi,

No, this is not possible. Only TicketID and TicketNumber are passed. They exist always, an CustomerID e.g. is optional. I strongly recommend writing a custom GenericAgent module instead of calling an external script. You'll have access to the complete API and implementing your request isn't that complex.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
Post Reply