Menu

How to include a result of an OQL query

2020-12-29
2021-01-19
  • Sébastien Potin

    Dear All,

    Is there a way to add the result of an OQL query to a notification?
    For example "All ticket assigned to a team"

    Thanks,
    Regards,
    Sébastien

     
  • Vincent @ Combodo

    Bonne année Sébastien,
    That's not possible, you can just provide a direct url to that particular query within iTop, but not send the result of that query.

    It's a good idea, but requires much more thinking...
    In version 3.0, we are implementing the possibility when defining the TO, CC or BCC of an email notification, to reuse existing Queries.

    Here, the idea could be to define placeholder such as $query:34(team=45,client='Demo')$ which would execute the OQL Query with id 34, passing the team and the client as parameters

    https://myitop/webservices/export-v2.php?query=45&arg_team=["34"]&arg_client=['Demo']

    But this is not really sufficient, the real need would be to specify the team and client as another placeholder inside the other one, which starts to be tricky. Something like
    $query:34(team=$this->team_id$, client=$this->org_id$)$
    Pretty sure that this version cannot be parsed.
    At the end, writing notification becomes really a complex job !

    The other option would be to directly include OQL queries within notification...

    The main difference between providing a link to the query and the real results of the query, is that the query is executed with the rights of the user who triggered the notification, which can be less or more than what the recipient(s) is allowed to see (assuming he even has an iTop login, which may not even be the case).

     
  • Pierre Goiffon

    Pierre Goiffon - 2021-01-18

    Hello,
    In theory you should be able to add your own new action (see ActionEmail class) using a custom module, but this would require some work !

     
  • Sébastien Potin

    Hello Vincent, Pierre,

    Thanks both for your replies !

    I'll try to investigate on the ActionEmail class, and check if I can create a new action.
    If I find a way to do it, I'll share

     

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.