Menu

Update the CMDB when closing a task

2022-07-04
2022-07-06
  • jean michel secconi

    Hi,
    I have a customized userRequest for ApplicationInstallation.
    When assigning the request, with itop-stencils, I create one task of installation for each component of the application. The task include the version of the component.
    I would like, when the user closes the task to automaticaly update the version of the installed component in my CMDB.
    The component to update can be simply identified by an OQL request but I don't know how to update it

     
  • Vincent @ Combodo

    Hi Jean-Michel,
    In the WorkOrder::AfterUpdate method if state is close and previous was not, retrieve the object to update from Database, change it and force it's update.
    Check the tutorials related to Automation
    There are multiple examples, where similar stuff are done

    This one, even propose a simpler method, by creating a new method doing the remote update and calling that method from the WorkOrder lifecycle
    For your use case no need to create a counter, just a method not AddValue, but UpdateComponentVersion for eg.

     

    Last edit: Vincent @ Combodo 2022-07-05
  • jean michel secconi

    Thanks a lot Vincent

     

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.