Menu

Reject Function in iTOP

3 days ago
14 hours ago
  • Samuel Diaz

    Samuel Diaz - 3 days ago

    Hi There!
    I have some questions about a customization I'm trying to implement.
    Initially, I created a reject function for the Service Desk Agent and Support Agent roles. These roles had a reject button and required users to enter a comment explaining the reason for the rejection. I implemented this directly in the iTOP core, and it worked perfectly. The problem is that when I tried to update, I received errors due to "corrupted" files (the XML files had been modified).
    I restored the original files to avoid corruption, and now I'm developing a separate extension. However, when I add the actions, transitions, stimulus, etc., the reject button doesn't appear when I run the extension. Could you help me determine if I'm doing this incorrectly? Here's the XML file I'm currently using in the extension:

    <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nonamespaceschemalocation="../../datamodels/2.x/itop_design.xsd" version="3.2"></itop_design>

    <classes></classes>

    <!-- ===================================================== -->
    <!-- Extend UserRequest                                   -->
    <!-- ===================================================== -->
    <class id="UserRequest" _delta="define">
    
      <!-- ===================== -->
      <!-- Reject reason field   -->
      <!-- ===================== -->
      <fields>
        <field id="reject_reason" xsi:type="AttributeText">
          <sql>reject_reason</sql>
          <is_null_allowed>true</is_null_allowed>
          <track_history>true</track_history>
        </field>
      </fields>
    
      <!-- ===================== -->
      <!-- Lifecycle extension   -->
      <!-- ===================== -->
      <lifecycle>
    
          <states>
    
            <!-- Rejected state -->
            <state id="rejected" _delta="define">
              <inherit_flags_from>new</inherit_flags_from>
              <flags>
                <attribute id="reject_reason">
                  <read_only/>
                </attribute>
              </flags>
            </state>
    
            <!-- Extend NEW -->
            <state id="new" _delta="define">
              <transitions _delta="define">
                <transition id="ev_reject">
                  <target>rejected</target>
                  <flags>
                    <attribute id="reject_reason">
                      <mandatory/>
                      <must_prompt/>
                    </attribute>
                  </flags>
                </transition>
              </transitions>
            </state>
    
            <!-- Extend ASSIGNED -->
            <state id="assigned" _delta="define">
              <transitions _delta="define">
                <transition id="ev_reject">
                  <target>rejected</target>
                  <flags>
                    <attribute id="reject_reason">
                      <mandatory/>
                      <must_prompt/>
                    </attribute>
                  </flags>
                </transition>
              </transitions>
            </state>
    
          </states>
    
        </lifecycle>
    
    
    </class>
    

    <user_rights>
    <profiles></profiles></user_rights>

      <!-- Service Desk Agent -->
      <profile id="4" _delta="define">
        <groups>
          <group id="UserRequest">
            <actions>
              <action id="stimulus:ev_reject">allow</action>
            </actions>
          </group>
        </groups>
      </profile>
    
      <!-- Support Agent -->
      <profile id="5" _delta="define">
        <groups>
          <group id="UserRequest">
            <actions>
              <action id="stimulus:ev_reject">allow</action>
            </actions>
          </group>
        </groups>
      </profile>
    
    </profiles>
    

     
  • Samuel Diaz

    Samuel Diaz - 3 days ago

    This is the profile section:

    <user_rights>
    <profiles></profiles></user_rights>

      <!-- Service Desk Agent -->
      <profile id="4" _delta="define">
        <groups>
          <group id="UserRequest">
            <actions>
              <action id="stimulus:ev_reject">allow</action>
            </actions>
          </group>
        </groups>
      </profile>
    
      <!-- Support Agent -->
      <profile id="5" _delta="define">
        <groups>
          <group id="UserRequest">
            <actions>
              <action id="stimulus:ev_reject">allow</action>
            </actions>
          </group>
        </groups>
      </profile>
    
    </profiles>
    

     
  • Samuel Diaz

    Samuel Diaz - 3 days ago

    I have iTOP 3.2 Community version

     
  • Vincent @ Combodo

    Most probably your extension is not installed, because that statement should crash iTop setup with a blocking error

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

    Check you module dependencies, it must be depends on itop-request-mgmt or itop-request-mgmt-itil.
    Check the XML reference for delta values and where to put them.
    On existing XML nodes, you should never set a "define", only on new XML nodes you must do this

     
    • Samuel Diaz

      Samuel Diaz - 3 days ago

      The extension was installed sucessfully, but it seems is not working:

       
      • Jeffrey Bostoen

        Jeffrey Bostoen - 14 hours ago

        Hm, rather than to define the entire class; you should ideally add a "dependency" (see module.xxx.php - "dependencies") to the module in which the original user request is defined. ( Probably itop-request-mgmt/3.2.0 or itop-request-mgmt-itil.3.2.0 ) .

        The XML format seems a bit messed up above; I hope your "class" node is within "classes"? And "classes" within "itop_design"?

         

Log in to post a comment.