Menu

How to add 3 Fields permanent to Incident Form

2022-05-18
2024-03-04
  • Wolle Petry

    Wolle Petry - 2022-05-18

    iTopVersion: 2.7.5-1
    iTopBuild: 7770
    iTopBuildDate: 2021-07-12 19:29:29
    DataModelVersion: 2.7.5
    MySQLVersion: 10.6.4-MariaDB
    PHPVersion: 7.3.31
    OSVersion: WINNT
    WebServerVersion: Microsoft-IIS/10.0


    Good morning @ all

    I am strugeling to add 3 fields to the incident form. (yes, the fields are needed in any new incident)
    I am quite sure the way goes over "make a new externsion"
    But other then modifiyng CI´s, in the incident Class there are so many stuff that is not clear to me.
    What part of the original incidentclass I have to put in my new extension "im-extension"
    Documentation isnt realy

    I have tried to copy everything inbetween <class></class>
    from "datamodels\2.x\itop-incident-mgmt-itil\datamodel.itop-incident-mgmt-itil.xml" /

    to my extension and even without any change, i can not run the setup without any errors.
    "Error loading module "imfield-extension": /itop_design/classes/class[Incident] at line 4: could not be found"

    Can someone please explain what part of .itop-incident-mgmt-itil.xml I really need
    or is this way complete wrong ?

    Maybe if someone knows a solution, and can modify ".itop-incident-mgmt-itil.xml" with 3 additional Fileds
    example:
    <field id="field1" xsi:type="AttributeString">
    <sql>field1</sql>
    <default_value>
    <is_null_allowed>false</is_null_allowed>
    </default_value></field>
    .....

    Thanks in advance

    Wolfgang

     

    Last edit: Wolle Petry 2022-05-18
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2022-05-18

    It's basically XML. You only need to include the new parts, or stuff you redefine. No need to include other nodes.

    But indeed, you should copy it in a new extension and add a dependency to the module where incident is defined (itop-incident-mgmt-itil/2.7.0 or something like that); so it processes the original definition first and then your modifications.

     
  • Wolle Petry

    Wolle Petry - 2022-05-18

    Thx Jeffrey,
    but still the problem that:
    "Error loading module "imfield-extension": /itop_design/classes/class[Incident] at line 4: could not be found"
    i have in the "new" extension the following dendencies: itop-config-mgmt/2.4.0,itop-tickets/2.4.0,itop-profiles-itil/2.3.0
    but running setup it will stop with the above error that the module "incident" can not be found.
    Here my try without any presentation tags (not needed so far for testing or ?)

    <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
    <classes>
    <class id="Incident" _delta="redefine">
    <parent>Ticket</parent>
    <fields>
    <field id="mangel" xsi:type="AttributeText" _delta="define">
    <sql>mangel</sql>
    <default_value>
    <is_null_allowed>false</is_null_allowed>
    </default_value></field>
    <field id="limit" xsi:type="AttributeText" _delta="define">
    <sql>limit</sql>
    <default_value>
    <is_null_allowed>false</is_null_allowed>
    </default_value></field>
    <field id="action" xsi:type="AttributeText" _delta="define">
    <sql>action</sql>
    <default_value>
    <is_null_allowed>false</is_null_allowed>
    </default_value></field>
    </fields>
    </class>
    </classes>
    </itop_design>

    what is missing or wrong ?

    Thx Wolfgang

     
  • Vincent @ Combodo

    Something must be wrong in your file
    module.imfield-extension.php
    Can you paste it?


    In addition this is wrong:

    <class id="Incident" _delta="redefine">
    

    You should put

    <class id="Incident" _delta="must_exist">
    

    Maybe ready carefully that portion

     
    • Wolle Petry

      Wolle Petry - 2022-05-18

      will add as attachment.

       

      Last edit: Wolle Petry 2022-05-18
    • Wolle Petry

      Wolle Petry - 2022-05-18

      have put "itop-incident-mgmt-itil/2.7.0" in module.imfield-exntension.php and setup was running without any error.

       
  • Vincent @ Combodo

    Then, your XML is missing the presentation part, so the fields aren't going to be displayed...

     

    Last edit: Vincent @ Combodo 2022-05-18
    • Wolle Petry

      Wolle Petry - 2022-05-18

      True, like I said, presentation is missing BUT for the setup it doesent realy matter because as long the setup doesnt run thru, it is not needed at the moment.
      As soon i can fix the setup problem, I will put the presentation in.

      But you are right ;-)

      Wolfgang

       
  • Wolle Petry

    Wolle Petry - 2022-05-18

    @ all

    THX for your help.
    itop-incident-mgmt-itil/2.7.0 worked like a charm.
    With presentation tag I am now able to have 3 additional fields in every Incident Report.

    stay healthy

    kind regards

    Wolfgang

     
  • Vincent @ Combodo

    In your module put a dependency on itop-incident-mgmt-itil as this is the module which declare the Incident class

            <class id="Incident" _delta="define">
    

    My answer comes to late. Nevertheless, happy to see that you passed the test.
    The first extension is the most tricky, but then once the logic is understood, it's quite easier ;-)

     

    Last edit: Vincent @ Combodo 2022-05-18
  • armando Navarro

    armando Navarro - 2024-03-04

    Hello good morning.

    I also want to add 3 options to the Incident form, but I don't know where to start, could someone please he

     

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.