CA Service Management

  • 1.  Prevent Copy Menu Item for Request ticket type only

    Posted Apr 12, 2017 03:37 PM

    Hola - in our organization, we prevent analysts from creating new requests directly into CA Service Desk so they use the Service Catalog instead. However, the requests are loaded into CA SD for the fulfillment portion (via PAM).  Once requests are in CA SD, they are 'copy-able'. 

     

    Therefore, we need a way to prevent File > Copy for Request type tickets only.  I read on the ServiceDeskUsers Forum, that the menubar_xx.htmpl form doesn't have access to $args. attributes of detail_pages, so it can't be done on this form.

     

    Has anyone figured out another way to prevent File > Copy for a specific ticket type?  Thanks!



  • 2.  Re: Prevent Copy Menu Item for Request ticket type only

    Posted Apr 12, 2017 03:42 PM

    Hi,

     

    I think you're asking about the Request List page.  If that's the case you can disable the Right Click>Copy option by changing a line in list_cr.htmpl.

     

    Open the file in WSP source view and change the following line.

     

    var cfgCanCopy = true;  //'Copy' entry in right click context menu of list page

     

    to

     

    var cfgCanCopy = false;  //'Copy' entry in right click context menu of list page



  • 3.  Re: Prevent Copy Menu Item for Request ticket type only

    Posted Apr 12, 2017 03:54 PM

    Hi Grant - thanks, we've got the list updated already.  However, we cannot find a way to prevent the following scenario:

     

    1. open request

    2. File > Copy - this is where we need to prevent a copy for Request type ticket only.

     

    Once our analysts hit File > Copy, they *think* they are creating a new request since the form opens up, only to have it fail at the 'Save' since they cannot create it.  This leads to frustration, along with an incident, until we explain that they must use the Catalog.

     

    Of course, maybe there's a way to have the detail page *not* open for a "File > Copy" Request when access type = analyst?  But only if we could create an appropriate error message like "please use the catalog to create requests".

     

    Thanks again!



  • 4.  Re: Prevent Copy Menu Item for Request ticket type only

    Posted Apr 12, 2017 04:26 PM

    Hi,

    here is 2 ways:

    1. Disable menubar (way disable menu item for specified role only):

    - Go to Roles > Resources > Tabs;

    - Check tabs that have possibility to open tickets (ex: Service Desk, Quick Profile);

    - In every tab you need to check "Menu Bar" attribute and get form name that linked with current tab for specified role;

    - Then modify that files (use form group folders if needed) and wrap <PDM_OBJECT> that includes <PDM_MACRO name=menuItem label="Copy" function="make_copy()"> with <PDM_IF 0>

    <PDM_IF 0>
    <PDM_OBJECT>
    if (    typeof w.ahdframe._dtl == "object" &&
            parseInt(w.cfgUserAuth) > 1 &&
             (   (   $ACCESS.FAC_cr >= 2 &&
                     typeof w.ahdframe.copy_from_cr != "undefined" ) ||
                 (   $ACCESS.FAC_chg >= 2  &&
                     typeof w.ahdframe.copy_from_chg != "undefined" ) ||
                 (   $ACCESS.FAC_iss >= 2  &&
                     typeof w.ahdframe.copy_from_iss != "undefined" ) ||
                 (   $ACCESS.FAC_nr >= 2 &&
                     typeof w.ahdframe.copy_from_nr != "undefined" ) ) &&
            w.ahdframeset.ahdframe._dtl.edit==false )
    {
       
    <PDM_MACRO name=menuItem label="Copy" function="make_copy()">
        if( typeof w.ahdframe.copy_from_nr != "undefined" ) {
           
    <PDM_MACRO name=menuItem label="Copy_(Including_All_Relationships)" function="ahdtop.popup_window('', 'MAKE_COPY', '', '', '', 'FACTORY=nr', 'PERSID='+ahdframe.argPersistentID, 'METHOD=make_asset_copy_w_relationships', 'KEEP.MAKE_COPY=1')">
        }
    }
    </PDM_OBJECT>
    </PDM_IF>

    OR

    - if you need to disable this feature only for Request and not for incidents, you can modify condition in this way:

    if (    typeof w.ahdframe._dtl == "object" &&
         w.ahdframe.requestType != "R" &&
            parseInt(w.cfgUserAuth) > 1 &&
             (   (   $ACCESS.FAC_cr >= 2 &&
                     typeof w.ahdframe.copy_from_cr != "undefined" ) ||
                 (   $ACCESS.FAC_chg >= 2  &&
                     typeof w.ahdframe.copy_from_chg != "undefined" ) ||
                 (   $ACCESS.FAC_iss >= 2  &&
                     typeof w.ahdframe.copy_from_iss != "undefined" ) ||
                 (   $ACCESS.FAC_nr >= 2 &&
                     typeof w.ahdframe.copy_from_nr != "undefined" ) ) &&
            w.ahdframeset.ahdframe._dtl.edit==false )

     

    2. Disable copy function:

    - Open detail_cr.htmpl;

    - Wrap function copy_from_cr() with /* */ (JavaScript comment signs);

    /*
    function copy_from_cr() {
         if ("$args.KEEP.MAKE_COPY" == "1") {
              var exceptions = new Array();
              exceptions[0] = "SET.customer";
              exceptions[0] = "SET.requested_by";
              detailCopyEditForm(exceptions);
         }
    }
    */

     

    Regards,

    cdtj



  • 5.  Re: Prevent Copy Menu Item for Request ticket type only

    Posted Apr 12, 2017 04:28 PM

    Interesting, I never noticed that Copy option.   You can disable that in the menubar file.  It's generated by this bit of code...

     

    <PDM_OBJECT>
    if ( typeof w.ahdframe._dtl == "object" &&
    parseInt(w.cfgUserAuth) > 1 &&
    ( ( $ACCESS.FAC_cr >= 2 &&
    typeof w.ahdframe.copy_from_cr != "undefined" ) ||
    ( $ACCESS.FAC_chg >= 2 &&
    typeof w.ahdframe.copy_from_chg != "undefined" ) ||
    ( $ACCESS.FAC_iss >= 2 &&
    typeof w.ahdframe.copy_from_iss != "undefined" ) ||
    ( $ACCESS.FAC_nr >= 2 &&
    typeof w.ahdframe.copy_from_nr != "undefined" ) ) &&
    w.ahdframeset.ahdframe._dtl.edit==false )
    {

    <PDM_MACRO name=menuItem label="Copy" function="make_copy()">
    if( typeof w.ahdframe.copy_from_nr != "undefined" ) {

    <PDM_MACRO name=menuItem label="Copy_(Including_All_Relationships)" function="ahdtop.popup_window('', 'MAKE_COPY', '', '', '', 'FACTORY=nr', 'PERSID='+ahdframe.argPersistentID, 'METHOD=make_asset_copy_w_relationships', 'KEEP.MAKE_COPY=1')">
    }
    }
    </PDM_OBJECT>

     

     

    To remove Copy option change the follow line 

    w.ahdframeset.ahdframe._dtl.edit==false )

    to

    w.ahdframeset.ahdframe._dtl.edit==false && w.propFormName != "detail_cr.htmpl") 

     

    This will inactivate the Copy option only on the Request page.