Menu

The transition doesn't work

2023-06-08
2023-06-09
  • Rafael AINCIART

    Rafael AINCIART - 2023-06-08

    Hi everyone!

    I'm encountering a situation that seems strange when customizing the lifecycle of a user request.

    A you can see in the screenshot in attach, I defined 2 transitions from resolved state. It is possible to close or to reopen the request. But in the console, there is only the "close" button that appears...
    The second screenshot shows the issue in the UI.

    My code is the following :

    <state id="resolved">
        <highlight>
            <code>closed</code>
        </highlight>
        <inherit_flags_from>assigned</inherit_flags_from>
        <flags>
            <attribute id="caller_id">
                <read_only/>
            </attribute>
            <attribute id="origin">
                <read_only/>
            </attribute>
            <attribute id="title">
                <read_only/>
            </attribute>
            <attribute id="description">
                <read_only/>
            </attribute>
            <attribute id="org_id">
                <read_only/>
            </attribute>
            <attribute id="team_id">
                <read_only/>
            </attribute>
            <attribute id="agent_id">
                <read_only/>
            </attribute>
            <attribute id="request_type">
                <read_only/>
            </attribute>
            <attribute id="resolution_date">
                <read_only/>
            </attribute>
            <attribute id="time_spent">
                <read_only/>
            </attribute>
            <attribute id="solution">
                <mandatory/>
                <must_prompt/>
            </attribute>
            <attribute id="pending_reason">
                <read_only/>
            </attribute>
        </flags>
        <transitions>
            <transition id="ev_close">
                <target>closed</target>
                <actions>
                    <action>
                        <verb>SetCurrentDate</verb>
                        <params>
                            <param xsi:type="attcode">close_date</param>
                        </params>
                    </action>
                </actions>
            </transition>
            <transition id="ev_reopen">
                <target>assigned</target>
                <actions>
                </actions>
            </transition>
        </transitions>
    </state>
    

    Can you help me to understand the problem?

    Thanks a lot!

    Rafael.

     
  • Guillaume Lajarige

    Hello Rafael,

    It might be because your user doesn't have the permission for these stimuli. Open the user page, then go to the "Grant Matrix" tab and check if the stimuli are alowed.

    Hope this helps,
    Guillaume

     
    • Rafael AINCIART

      Rafael AINCIART - 2023-06-08

      You're perfectly right! Thanks!
      The user profile allow all the others stimuli but not this one.
      How can I manage the grant matrix to associate the 'reopen' stimuli to the dedicated profile please?

       
    • Rafael AINCIART

      Rafael AINCIART - 2023-06-08

      Ok, I think I have to redefine this nodes

      <group id="UserRequest">
                  <actions>
                    <action id="action:write">allow</action>
                    <action id="action:bulk write">allow</action>
                    <action id="stimulus:ev_assign">allow</action>
                    <action id="stimulus:ev_reassign">allow</action>
                    <action id="stimulus:ev_resolve">allow</action>
                    <action id="stimulus:ev_close">allow</action>
                    <action id="stimulus:ev_pending">allow</action>
                    <action id="stimulus:ev_wait_for_approval">allow</action>
                  </actions>
                </group>
      

      from datamodel.itop-profiles-itil.xml

       
  • Guillaume Lajarige

    You have to check if the profiles that your user has, have the "UserRequest" group.
    You don't necessarly need to redefine this node.

     
    • Rafael AINCIART

      Rafael AINCIART - 2023-06-08

      In the Grant matrix, the "UserRequest" group appears (for Support Agent profile) and it allows all the stimuli, except the 'reopen' one.
      I have to allow the reopen stimuli in the "UserRequest" group for the Support Agent profile (id=5).
      I think it is only possible by redefining this node. Am I right?

       
    • Guillaume Lajarige

      It depends on what you aim at. If you do that, all profiles having "UserRequest" will be able to re open request, including support agents.

      If you only want some profiles to be able to reopen user requests, then you should add a new group with the stimulus, then add this group to the said profiles.

      Hope it helps,
      Guillaume

       

      Last edit: Guillaume Lajarige 2023-06-08
      • Rafael AINCIART

        Rafael AINCIART - 2023-06-08

        I try to follow your advices and implement them but it doesn't work as I expect.
        I added this in my datamodel :

        <user_rights>
                <groups>
                    <group id="UserRequest_for_SA" _delta="define">
                        <classes>
                            <class id="UserRequest"/>
                        </classes>
                    </group>
                </groups>
                <profiles>
                    <profile id="5" _delta="redefine">
                        <name>Support Agent</name>
                        <description>Person analyzing and solving the current incidents</description>
                        <groups>
                            <group id="UserRequest_for_SA">
                                <actions>
                                    <action id="action:write">allow</action>
                                    <action id="action:bulk write">allow</action>
                                    <action id="stimulus:ev_assign">allow</action>
                                    <action id="stimulus:ev_resolve">allow</action>
                                    <action id="stimulus:ev_close">allow</action>
                                    <action id="stimulus:ev_pending">allow</action>
                                    <action id="stimulus:reopen">allow</action>
                                </actions>
                            </group>
                        </groups>
                    </profile>
                </profiles>
            </user_rights> 
        

        It deletes all the standard rights for the users in the profile.

        I try to understand the right management with this documentation
        https://www.itophub.io/wiki/page?id=3_0_0:customization:add-profile-sample
        but it is not clear for me sorry.

        Am I on the right direction?

         

        Last edit: Rafael AINCIART 2023-06-08
      • Rafael AINCIART

        Rafael AINCIART - 2023-06-08

        Finaly, I think this code would be more appropriate :

        <user_rights>
            <profile id="5" _delta="must_exist">
                <groups>
                    <group id="UserRequest" _delta="must_exist">
                        <actions>
                            <action id="stimulus:reopen">allow</action>
                        </actions>
                    </group>
                </groups>
            </profile>
        </user_rights>
        

        But when I want to "setup" with the new extension, it makes this error :

        Error loading module "my-extension": /itop_design/user_rights/profile[5] at line 2528: could not be found - Loaded modules: dictionaries:1.0, core:1.0, application:1.0, authent-cas:3.0.3, authent-external:3.0.3, authent-local:3.0.3, combodo-backoffice-darkmoon-theme:3.0.3, itop-attachments:3.0.3, itop-backup:3.0.3, itop-config:3.0.3, itop-files-information:3.0.3, itop-portal-base:3.0.3, itop-portal:3.0.3, itop-profiles-itil:3.0.3, itop-sla-computation:3.0.3, itop-structure:3.0.3, itop-themes-compat:3.0.3, itop-tickets:3.0.3, itop-welcome-itil:3.0.3, combodo-db-tools:3.0.3, email-reply:1.4.1, itop-config-mgmt:3.0.3, itop-core-update:3.0.3, itop-hub-connector:3.0.3, itop-oauth-client:3.0.3, itop-request-mgmt:3.0.3, itop-service-mgmt:3.0.3, my-extension:1.0.0

        It looks like a problem of dependencies in my module.my-extension.php. I tried several declarations but it still fails...

             'dependencies' => array(
                    'itop-tickets/3.0.0',
                    'itop-request-mgmt/3.0.0',
                    'combodo-backoffice-darkmoon-theme/3.0.0',
                    'itop-structure/3.0.0',
                    'itop-profiles-itil/3.0.0',
                    'authent-cas/3.0.0',
                ),
        

        Any idea to help me?

         
  • Guillaume Lajarige

    The XML is missing a <profiles> node between <user_rights> and <profile>.
    Also, I think you will need to add a _delta="define" flag on the <action> node, otherwise it won't compiled correctly.</action></profile></user_rights></profiles>

    Hope this helps,
    Guillaume
    
     
    • Rafael AINCIART

      Rafael AINCIART - 2023-06-09

      Thanks Guillaume!
      It works for the compilation \o/
      But the stimuli ev_reopen still not appears in the grant matrix for the profile... Arghhhh !!!
      It makes me crazy!

       
  • Guillaume Lajarige

    Can you share your complete XML ?

     
    • Rafael AINCIART

      Rafael AINCIART - 2023-06-09

      Yes! Here is the file

       
  • Guillaume Lajarige

    It might be because it's stimulus:ev_reopen instead of stimulus:reopen :)

    Guillaume

     
    • Rafael AINCIART

      Rafael AINCIART - 2023-06-09

      Oh no! Shame on me!
      You're right.
      I just test it and now it works perfectly!
      Many many many thanks for your help Guillaume :)

       
    • Guillaume Lajarige

      Glad to see you fixed it!

      Have a nice WE :)
      Guillaume

       
      • Rafael AINCIART

        Rafael AINCIART - 2023-06-09

        Thanks to you!
        Have a good weekend too ;)

         

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.