Menu

Lookup/queried read-only field in FunctionalCI based on linked Contact?

Wong
2023-07-13
2023-07-13
  • Wong

    Wong - 2023-07-13

    Hi community,

    I believe many of the users has this requirement where they need to export
    a list of FCIs with the linked contact info. It is easy enough with
    phrasebook and a saved query.

    I have deployed iTop in my current environment. Looks like they have more
    reporting requirements than I have ever seen, and they are asking for a way
    to easily export a list of CI with a user name column. I was able to
    achieve this by saving some queries like this:
    SELECT A,c FROM FunctionalCI AS A JOIN lnkContactToFunctionalCI AS l ON
    l.functionalci_id=A.id JOIN Contact AS c ON l.contact_id=c.id
    in the phrasebook and having them filter it in Excel but they are asking
    about ways to export the list with easily configurable filters.

    So I was thinking, is it possible to add a read-only field to the class,
    and on update/creation of the class, or creation/deletion/modification of
    class lnkContactToFunctionalCI, fetches the name of the contact
    (lnkContactToFunctionalCI.contact_name) and put into that field in the FCI?

    I considered using a cron job running every once in a while to grab and
    update, but the data discrepancy between updates might get me into trouble.

    Other things I was considering:
    - What if the FCI has more than 1 contact linked? A. In that case I will
    revert to showing text "Multiple"

    I was looking at this page:
    https://www.itophub.io/wiki/page?do=export_code&id=3_0_0:customization:cascade-update
    It sounds like it might be somewhere to start, am I right?

    I will greatly appreciate it if anyone could point me in the right
    direction. Also, will iTop consider adding this function in future releases?

    Thanks all!

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2023-07-13

    It's one way to do it. Or you could create a customization which does it at the time you actually need it. For instance, you could use and extend https://github.com/jbostoen/itop-jb-report-generator to query all the functional CIs with linked contact info; and at that very moment add an action which enriches the data (functional CIs -> add list of contacts) and finally have a custom report as output.

     

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.