Menu

Trigger when linking a Contact to a Ticket does not work

Zwettler
2022-07-15
2022-07-21
  • Zwettler

    Zwettler - 2022-07-15

    Hello together!
    What i like to realize is: When a Contact ist linked to a Ticket (User Request in Helpdesk) an eMail should be sent to the Contact that was linked to the Ticket. (I can already handle the triggers and e-mail well, and sending e-mails generally works! I realized many trigger/emails by now)

    But i have some problems to realize this special Trigger/E-Mail.
    * when i use a specific adress in the "TO" attibubute -> everything works find
    * but if i try to grab the linked contakt -> the email is not sent
    * This is what i wrote into the TO attribute:

    SELECT Person AS p JOIN lnkContactToTicket AS l ON l.contact_id=p.id WHERE l.ticket_id = :this->id

    When i'm testing the sql/oql I get the list oft contacts that are linked to the ticket very well. Depending on the ammount of linked contacts I do get 1 one or more contacts as a result.

    I do not understand why the SELECT statement does not deliver the mails to the linked contacts.

    Please see attached files.

    Kind Regards,
    Günther Huber

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2022-07-15

    Can you show the related trigger as well? It may be crucial to know how ":this->id" is interpreted, as it may very well refer to the link ID rather than the ticket ID!

    You might be looking for " l.id = :this->id " instead?

     
  • Zwettler

    Zwettler - 2022-07-21

    Hi Jeffrey, attached find the configuration of the trigger.

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2022-07-21

    See my remark above. :this->id will refer to the ID of the link you create, as you specified the "creation of a Link Contact / Ticket" as target class.

    So this would in fact need to be an OQL query similar to this:

    SELECT Person AS p WHERE p.id = :this->contact_id
    

    (Select the person whose ID is the same as the contact_id of this link)

     
  • Zwettler

    Zwettler - 2022-07-21

    Thanks, I understand that. It looks like the trigger is not fired at all. I tested this by using a e-Mail adresse TO = SELECT Person WHERE name LIKE 'my_name%'.

    The notification-tab does not count up, as you can see in the attached pic.

    Any idea?

     
  • Zwettler

    Zwettler - 2022-07-21

    ... everything works fine now - it was a (simple) problem with the e-mail-server.
    kind regards and thanks
    G.H.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.