Menu

Disable solution requirement?

2025-01-16
2025-02-17
1 2 > >> (Page 1 of 2)
  • Niclas Eriksson

    Niclas Eriksson - 2025-01-16

    Is there a way to remove the requirement of adding a solution when closing a user request? I got that question from my manager to look into. Maybe just to add a button to "Resolve without adding solution" or to just close the ticket without the box for solution even appearing?

     
  • Niclas Eriksson

    Niclas Eriksson - 2025-01-16

    It would also be great if there is a way to close a ticket directly from the public log, like the checkbox for "Notify" or similar.

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2025-01-16

    I also hated that :)

    Yes, you can customize all the fields (and transitions and much more) in iTop. For that however, you usually need to create an extension to customize the datamodel.

    There's some really good documentation by Combodo. And some official examples; but there's a lot more in this repository too on how to accomplish certain things.

    Most useful resources are:
    https://www.itophub.io/wiki/page?id=latest:customization:xml_reference
    https://www.itophub.io/wiki/page?id=latest:customization:datamodel#content_of_a_module
    https://www.itophub.io/wiki/page?id=latest:customization:portal_xml

    Or, reach out to someone.

    --

    Where do you mean exactly? As you can enter a new public log; and then just use 'send and mark as resolved'?

     
    • Niclas Eriksson

      Niclas Eriksson - 2025-01-16

      Am I on the right track if I need to create an extension that includes a js that will override the "Mark as resolved" button ? If so, is this the correct way to include the JS in the module php?

      'js' => array(
          'disable_solution_popup.js',
      ),
      

      I've also in the datamodel xml entered this in order to make the solution not mandatory:

      <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.6">
      <class id="UserRequest">
              <fields>
                  <field id="solution" xsi:type="AttributeText">
                      <mandatory>false</mandatory>
                  </field>
              </fields>
          </class>
      </itop_design>
      

      I have a JS that contains this :

      $(document).on('click', '#ibo-popover-menu--item-6788f26b248f3323170488--ev_resolve', function() {
                      var requestId = $(this).data('request-id');
                      var jsonData = JSON.stringify({
                          operation: 'core/apply_stimulus',
                          class: 'UserRequest',
                          key: requestId,
                          stimulus: 'ev_resolve'
                      });
      

      But it doesn't seem to load the JS file at all if I reload the page and look into F12-Network.

       
    • Niclas Eriksson

      Niclas Eriksson - 2025-01-17

      I now got the JS to load.. I found the "class XXX implements \iBackofficeReadyScriptExtension".. which made things work as it should.

      I now just have to make the JS work properly to actually close the ticket. I did a test using a API post, but that requires authenticion of course, and I'm not sure it's a good idea to include a token in the code? Or is there any way to close the ticket without using API?

       
    • Niclas Eriksson

      Niclas Eriksson - 2025-01-21

      Hi Jeffrey!
      I saw your example (see below) on how you did it. But I can't seem to get past the setup of the extension as you see. It fails no matter what I do :( Can you maybe help me?

       
  • Niclas Eriksson

    Niclas Eriksson - 2025-01-16

    OK thanks, that was expected.. I'll look into creating a new extension for it :)

     
  • Niclas Eriksson

    Niclas Eriksson - 2025-01-16

    I was thinking that maybe it could be another checkbox beside "Notify" for closing the ticket directly from the public log entry. But I see now that send and marked as resolved is better to use :) So nevermind... If I solve an extension to not require solotion this is the way to go :)

     
  • Vincent @ Combodo

    If your strategy is to totally remove the prompting of additional info when closing a UserRequest, you just need to remove this field from the flag within the UserRequest lifecycle in the ev_resolve transition, this is pure XML and does not requires to write any JS

     
  • Niclas Eriksson

    Niclas Eriksson - 2025-01-17

    Thats sound great! I'm not sure how to remove that though, could you tell me how?

     
  • Vincent @ Combodo

    Here is the tuto to make a field mandatory in a transition, to do the opposite, you more or less need to remove that XML branch with a delta="delete"

    There could be more transition from other starting state where you want to remove this

        <class id="UserRequest">
          <lifecycle>
            <states>
              <state id="assigned">
                <transitions>
                  <transition id="ev_resolve" _delta="must_exist">
                    <flags>
                      <attribute id="solution" _delta="delete_if_exists"/>
                      </attribute>
                    </flags>
                  </transition>
                </transitions>
              </state>
               <state id="resolve">
                    <flags>
                      <attribute id="solution" _delta="delete"/>
                      </attribute>
                    </flags>
                </state>
            </states>
          </lifecycle>
        </class>
    
     
  • Niclas Eriksson

    Niclas Eriksson - 2025-01-17

    This seems far easier :) I'll try this out.. Thanks!

     
  • Niclas Eriksson

    Niclas Eriksson - 2025-01-17

    I get this error when installing the extension:
    /itop_design/class[UserRequest]/lifecycle/states/state[assigned]/transitions/transition[ev_resolve] at line 13: could not be found or marked as removed

    Any input on what could be wrong?

     
  • Niclas Eriksson

    Niclas Eriksson - 2025-01-17

    If I look under Datamodel - UserRequest and "States and Transitions" I see this:

    Resolved (resolved)
    - Close this request (ev_close) -> Closed (closed) (SetCurrentDate(attcode:close_date))
    - Re-open (ev_reopen) -> Assigned (assigned)
    Automatic resolve (ev_autoresolve) - > Resolved (resolved),SetCurrentDate(attcode:resolution_date), SetElapsedTime(attcode:time_spent, attcode:start_date, string:DefaultWorkingTimeComputer), ResolveChildTickets())

    I don't see the "ev_resolve" ?

    I've tried to use "ev_close" instead, but no luck with that either.

     

    Last edit: Niclas Eriksson 2025-01-17
    • Niclas Eriksson

      Niclas Eriksson - 2025-01-17

      Ignore this.. I looked at the wrong state, it's in the Assigned state of course.. :)

       
  • Niclas Eriksson

    Niclas Eriksson - 2025-01-17

    If I look inte network - doc when I resolve a request I see this call is made:
    <urltoitop>/pages/UI.php?stimulus=ev_resolve&class=UserRequest&operation=stimulus&id=386</urltoitop>

    So It seems that it actually uses the ev_resolve on the class. So is there maybe something wrong in my XML?

    <?xml version="1.0" encoding="UTF-8"?>
    <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.6">
        <class id="UserRequest">
            <lifecycle>
                <states>
                    <state id="assigned">
                        <transitions>
                            <transition id="ev_resolve" _delta="must_exist">
                                <flags>
                                    <attribute id="solution" _delta="delete_if_exists"/>
                                </flags>
                            </transition>
                        </transitions>
                    </state>
                    <state id="resolve">
                        <flags>
                            <attribute id="solution" _delta="delete"/>
                        </flags>
                    </state>
                </states>
            </lifecycle>
        </class>
    </itop_design>
    
     
  • Vincent @ Combodo

    Sorry I have not tested my XML, check the raw datamodel XML files to see how it is truly defined by default and how to change it. I use to do it in a few clicks in the ITSM Designer so, I never remember by heart how to do it in pure XML...

     
  • Niclas Eriksson

    Niclas Eriksson - 2025-01-20

    So in the datamodel.itop-request-mgmt-itil.xml I see this config regarding "solution":

    Under the state "assigned":

    <transition id="ev_resolve">
                    <target>resolved</target>
                    <actions>
                      <action>
                        <verb>SetCurrentDate</verb>
                        <params>
                          <param xsi:type="attcode">resolution_date</param>
                        </params>
                      </action>
                      <action>
                        <verb>SetElapsedTime</verb>
                        <params>
                          <param xsi:type="attcode">time_spent</param>
                          <param xsi:type="attcode">start_date</param>
                          <param xsi:type="string">DefaultWorkingTimeComputer</param>
                        </params>
                      </action>
                      <action>
                        <verb>ResolveChildTickets</verb>
                        <params/>
                      </action>
                    </actions>
                  </transition>
    

    So no relation to Solution what I can see.
    Then under the state "resolved":

    <state id="resolved">
        <highlight>
          <code>closed</code>
        </highlight>
        <inherit_flags_from>assigned</inherit_flags_from>
        <flags>
    
          <attribute id="resolution_code">
            <mandatory/>
            <must_prompt/>
          </attribute>
          <attribute id="solution">
            <mandatory/>
            <must_prompt/>
          </attribute>
    

    So what I've done was to look at the example from Jeffrey and added this into my Extension:

    <?xml version="1.0" encoding="UTF-8"?>
    <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.6">
        <class id="UserRequest">
            <lifecycle>
                <states>
                    <state id="resolved">
                            <flags>
                                    <attribute id="solution">
                                            <hidden _delta="merge"/>
                                            <mandatory _delta="delete"/>
                                            <must_prompt _delta="delete"/>
                                    </attribute>
                                    <attribute id="resolution_code">
                                            <hidden _delta="merge"/>
                                            <mandatory _delta="delete"/>
                                            <must_prompt _delta="delete"/>
                                    </attribute>
                            </flags>
                    </state>
                </states>
            </lifecycle>
        </class>
    </itop_design>
    

    But that results in this error during setup:

    Error loading module "jnit-disablesolution": /itop_design/class[UserRequest]/lifecycle/states/state[resolved]/flags/attribute[solution]/mandatory at line 11: could not be deleted (not found)

    So it seems not to find it ?

     

    Last edit: Niclas Eriksson 2025-01-20
  • Vincent @ Combodo

    2 options, either you are not running in full ITIL (2 different classes for Incident and UserRequest) or some other customization has already changed this.
    replace your "delete" by a "delete_if_exists"

     
    • Niclas Eriksson

      Niclas Eriksson - 2025-01-20

      In the config I use "ITIL Compliant Ticket Management" and have ticked "User Request mgmt", "Incidient Mgmt" and "Customer portal".
      I'll look into if I see any other config file/extension to find coliding configs..

       
  • Niclas Eriksson

    Niclas Eriksson - 2025-01-20

    The only thing I find is that we use the extension "Dispatch to team" with this config but that shouldn't interfere, correct?

    <class id="UserRequest" _delta="must_exist">
      <fields>
        <field id="status" xsi:type="AttributeEnum" _delta="must_exist">
          <values>
            <value id="dispatched" _delta="define">
              <code>dispatched</code>
              <rank>50</rank>
              <style>
                <main_color>$ibo-lifecycle-neutral-state-primary-color</main_color>
                <complementary_color>$ibo-lifecycle-neutral-state-secondary-color</complementary_color>
                <decoration_classes/>
              </style>
            </value>
            <value id="redispatched" _delta="define">
              <code>redispatched</code>
              <rank>55</rank>
              <style>
                <main_color>$ibo-lifecycle-neutral-state-primary-color</main_color>
                <complementary_color>$ibo-lifecycle-neutral-state-secondary-color</complementary_color>
                <decoration_classes/>
              </style>
            </value>
          </values>
        </field>
        <field id="tto" xsi:type="AttributeStopWatch" _delta="must_exist">
          <states>
            <state id="dispatched" _delta="define"/>
          </states>
        </field>
        <field id="ttr" xsi:type="AttributeStopWatch" _delta="must_exist">
          <states>
            <state id="dispatched" _delta="define"/>
            <state id="redispatched" _delta="define"/>
          </states>
        </field>
      </fields>
      <lifecycle>
        <stimuli>
          <stimulus id="ev_dispatch" xsi:type="StimulusUserAction" _delta="define"/>
        </stimuli>
        <states>
          <state id="new" _delta="must_exist">
            <transitions>
              <transition id="ev_dispatch" _delta="define">
                <target>dispatched</target>
                <actions/>
              </transition>
            </transitions>
          </state>
          <state id="approved" _delta="must_exist">
            <transitions>
              <transition id="ev_dispatch" _delta="define">
                <stimulus>ev_dispatch</stimulus>
                <target>dispatched</target>
                <actions/>
              </transition>
            </transitions>
          </state>
          <state id="assigned" _delta="must_exist">
            <transitions>
              <transition id="ev_dispatch" _delta="define">
                <target>redispatched</target>
                <actions>
                  <action>
                    <verb>Reset</verb>
                    <params>
                      <param xsi:type="string">agent_id</param>
                    </params>
                  </action>
                </actions>
              </transition>
            </transitions>
          </state>
    
     
  • Niclas Eriksson

    Niclas Eriksson - 2025-01-20

    But now I actually get another error..

    Error loading module "itop-request-mgmt-itil": /class[UserRequest] at line 4 could not be added : already exists in `/itop_design/classes/class[UserRequest]

     
    • Niclas Eriksson

      Niclas Eriksson - 2025-01-20

      Forget this.. I added a <parent>Ticket</parent> when testing to see if that matter, that is now removed. So this how it looks now.

      <?xml version="1.0" encoding="UTF-8"?>
      <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.6">
                  <classes>
                      <class id="UserRequest" _delta="must_exist">
                          <lifecycle>
                              <states>
                                  <state id="resolved">
                                      <flags>
                                          <attribute id="solution">
                                              <hidden _delta="merge"/>
                                              <mandatory _delta="delete_if_exists"/>
                                              <must_prompt _delta="delete_if_exists"/>
                                          </attribute>
                                          <attribute id="resolution_code">
                                              <hidden _delta="merge"/>
                                              <mandatory _delta="delete_if_exists"/>
                                              <must_prompt _delta="delete_if_exists"/>
                                          </attribute>
                                      </flags>
                                  </state>
                              </states>
                          </lifecycle>
                      </class>
                  </classes>
      </itop_design>
      
       
  • Niclas Eriksson

    Niclas Eriksson - 2025-01-20

    Seems to me that the two extensions don't like each other? :)
    Should I maybe add some delta on the <class id="UserRequest" _delta=xxxx in my extension to make it not colide?

     
  • Niclas Eriksson

    Niclas Eriksson - 2025-02-12

    OK, could someon please help. This is how my extension looks like right now:

    <?xml version="1.0" encoding="UTF-8"?>
    <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.6">
        <classes>
            <class id="UserRequest">
                <lifecycle>
                    <states> 
                        <state id="new">
                            <flags>
                                <attribute id="solution">
                                    <hidden _delta="merge"/>
                                </attribute>
                                <attribute id="resolution_code">
                                    <hidden _delta="merge"/>
                                </attribute>
    
                            </flags>
                        </state>
                        <state id="resolved">
                            <flags>
                                <attribute id="solution">
                                    <hidden _delta="merge"/>
                                    <mandatory _delta="delete"/>
                                    <must_prompt _delta="delete"/>
                                </attribute>
                                <attribute id="resolution_code">
                                    <hidden _delta="merge"/>
                                    <mandatory _delta="delete"/>
                                    <must_prompt _delta="delete"/>
                                </attribute>
                            </flags>
                        </state>
                    </states>
                </lifecycle>
            </class>
        </classes>
    </itop_design>
    

    And if I try to install it I get this error:

    Error loading module "itop-request-mgmt-itil": /class[UserRequest] at line 4 could not be added : already exists in /itop_design/classes/class[UserRequest] created_in: [jnit-disablesolution] at line 4

    So it seems that my new extension is making the original one to fail.

    So then I tried to add:
    <class id="UserRequest" _delta="must_exist">

    But then the error is:

    Error loading module "jnit-disablesolution": /itop_design/classes/class[UserRequest] at line 4: could not be found or marked as removed

    I'm a bit lost now... What am I doing wrong?

     
1 2 > >> (Page 1 of 2)

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.