Menu

(OQL Query): Send a email to the user's manager

Rosario.F
2022-02-18
2022-02-21
  • Rosario.F

    Rosario.F - 2022-02-18

    Hi Guys,

    in my iTop (2.7) I have created a lot of notifications with which I send an email to the person who opened the ticket. In the "TO" field I used the query:

    "SELECT Person WHERE id =: this-> caller_id"

    Now, I'd also like to send a carbon copy (CC) email to the user's function manager.
    Could you help me to write the quely?

    Thank you so much,
    Rosario

     
  • Vincent @ Combodo

    SELECT Person AS manager 
    JOIN Person AS employee ON employee.manager_id = manager.id
    WHERE employee.id=:this->caller_id
    
     

    Last edit: Vincent @ Combodo 2022-02-18
    • Rosario.F

      Rosario.F - 2022-02-21

      Thank you so much Vincent,
      your query works

       
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2022-02-18

    One way to do it, would be to extend the ticket class with an AttributeExternalField so you can add caller_manager_id to the ticket class. Additional benefit: you can show the manager in the ticket presentation if wanted.

    Then the query becomes as simple as

    SELECT Person WHERE id = :this->caller_id OR id = :this->caller_manager_id
    
     
    • Rosario.F

      Rosario.F - 2022-02-21

      Thanks for the tip Jeffrey, I solved it with Vincent's query

       

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.