CA Service Management

Expand all | Collapse all

add a new item to the "right click" options on the list_in.htmpl form

Jump to Best Answer
  • 1.  add a new item to the "right click" options on the list_in.htmpl form

    Posted 07-07-2016 01:47 PM

    Much like you can Update Status... or Log Comment..., our users would like to be able to update the information in our "1. Additional Information -> 4. Operational" subtab.

     

    Ideally the ticket would open in edit to the tab, but if I need to create a new form and have that update the information in that tab instead (which is what Log Comment... appears to do), that's fine.



  • 2.  Re: add a new item to the "right click" options on the list_in.htmpl form

    Posted 07-08-2016 01:28 AM

    Hello Joe,

     

    Not quite with what you're trying to do.

     

    1) I take it that your "4. Operational" tab is a new custom tab that you've added to the Incident?

     

    2) What version of SDM/ITSM?

     

    3) Maybe you could have a look at the form that currently does "Outage?" It contains examples of fields on a form that allow direct user input when in Edit mode.

     

    Edit tab new form.png

     

    Thanks, Kyle_R.



  • 3.  Re: add a new item to the "right click" options on the list_in.htmpl form

    Posted 07-08-2016 10:18 AM

    When a search is done for incidents there is a list of results. Right-clicking on one of the results gives you a menu and from there you can Log a Comment.... for instance. Want to add an option to this right-click menu to open the ticket to this Operational tab and have the ticket in edit mode, or have it open a form that updates the ticket like Log a Comment... does

    1. We renamed Outage and added some custom checkboxes to it. This was done before I got here.

    2. SDM 14.1 cum#2



  • 4.  Re: add a new item to the "right click" options on the list_in.htmpl form

    Posted 07-13-2016 08:19 PM

    Hello Joe,

     

    For "Want to add an option to this right-click menu ..."  start with:

    Which JavaScript file controls the right-click menu within ticket list screens in CA Service Desk Manager (CA SDM)?

     

    You're into some customisation here which is trickier than just changing the names on the right-click menus.

     

    You  may want to start with the above link, and also use "F12" on a browser or other HTML tracer to see what the current functionality of "Log Comments" does, and then see if you can approximate that. I'm not sure how far this can be taken.

     

    Thanks, Kyle_R.



  • 5.  Re: add a new item to the "right click" options on the list_in.htmpl form

    Posted 07-08-2016 06:55 AM

    The following may be handy as well with regards to updating the 'Context Menu" tha appears when you right-click on the list form:

     

    http://www.ca.com/us/support/ca-support-online/product-content/knowledgebase-articles/tec1217945.aspx

     

    http://www.ca.com/us/support/ca-support-online/product-content/knowledgebase-articles/tec477199.aspx

     

    Regards,

    Brian



  • 6.  Re: add a new item to the "right click" options on the list_in.htmpl form

    Posted 07-11-2016 04:05 PM

    The first link has some promise. Would you know where the "var cfgCanCopy" is pulled from? That might have the code I need but idk where that's coming from.

     

    Your second link doesn't seem to apply. I wasn't even able to change text values copying what it had as an example. IDK if that's b/c it's Unicenter dependent which we're not running.



  • 7.  Re: add a new item to the "right click" options on the list_in.htmpl form

    Former Employee
    Posted 07-13-2016 04:56 PM

    Anything more for JoeSchmo  Brian_Mathato ? Thanks!



  • 8.  Re: add a new item to the "right click" options on the list_in.htmpl form

    Posted 07-15-2016 02:15 PM

    Modifying Resultset.js stops search from coming up, as well as any results when clicking all incidents from scoreboard.

    Using web dev tools "Log Comment..." calls:

     

    ctxMenu.addItem( msgtext("Log_Comment..."),  // Log Comment...

             "rsDoActivity(self.activePersid, self.activeFactory, 'LOG')"

     

    in Resultset.js. I have tried using the "//Add custom items to the top/middle/bottom" based on the above:

     

    if( typeof resultSetCustomContextAddMiddle != "undefined" ) {

            resultSetCustomContextAddMiddle(ctxMenu.addItem( msgtext("Log_Comment..."),  // Log Comment...

             "rsDoActivity(self.activePersid, self.activeFactory, 'LOG')"

    );

     

    I have no idea where to start on sitemods.js, it seems like it's all for menu tabs unless I'm reading it wrong.



  • 9.  Re: add a new item to the "right click" options on the list_in.htmpl form

    Posted 07-18-2016 03:20 PM

    I can open the ticket in edit via:

    ctxMenu.addItem( "Operational_Tab...", "showEdit(self.activePersid)" );

     

    and I can open the ticket with:

    function rsOpenTicket(persid, factory, type) {

      var url = cfgCgi +

       "?SID=" + cfgSID +

       "+FID=" + fid_generator() +

       "+OP=SHOW_DETAIL+FACTORY=" + factory +

       "+PERSID=" + persid +

       "+KEEP.POPUP_NAME=USD1468611247771+KEEP.use_role=1";

      

      switch(factory) {

      case "cr":

      case "in": // SDT 19319 - ITIL

      case "pr": // SDT 19319 - ITIL

                            url += "xx_service_outage_tab.htmpl+KEEP.use_role=1#";

      break;

      case "chg":

      url += "detail_chgalg_edit.htmpl";

      break;

      case "iss":

      url += "detail_issalg_edit.htmpl";

      break;

      }

     

     

            popupActivityWithURL( url );

    }

    ctxMenu.addItem( "Operational_Tab...", "rsOpenTicket(self.activePersid, self.activeFactory, 'LOG')" );

     

    These were built from code already in place. So using the first I just need to get it to then move to the tab. Using the second I need to get it into Edit mode and then get to the tab. I don't know where the code for "showEdit" is so i'm mostly focusing on the second.



  • 10.  Re: add a new item to the "right click" options on the list_in.htmpl form

    Posted 07-26-2016 02:39 PM

    Current state:

    in resultset.js I have the function:

    function rsOpenTicket(persid) {

      var url=cfgCgi+

      "?SID="+cfgSID+

      "+FID="+fid_generator()+

      "+OP=SHOW_DETAIL"+

      "+FACTORY=cr"+

      "+PERSID="+persid+

      "+HTMPL=detail_outage.htmpl";

      popupActivityWithURL(url);

    }

     

    invoked here:

    if ( typeof cfgContextActivities == "boolean" && cfgContextActivities ) {

          ctxMenu.addItem( msgtext("Transfer..."),  // Transfer...

                  "rsTransfer(self.activePersid, self.activeFactory, 'TR')" );

          ctxMenu.addItem( msgtext("Escalate..."),  // Escalate...

                  "rsTransfer(self.activePersid, self.activeFactory, 'ESC')" );

          ctxMenu.addItem( "Operational_Tab...",  // Operational Tab...

                  "rsOpenTicket(self.activePersid)" );

          ctxMenu.addItem( msgtext("Manual_Notify..."),  // Manual Notify...

                  "rsTransfer(self.activePersid, self.activeFactory, 'NF')" );

          if(ahdtop.canDisplayLiveAssistanceLink()){

            ctxMenu.addItem( msgtext("Live_Assistance"),  // Live Assistance

                    "ahdtop.inviteEndUser(self.activePersid)");

     

    detail_outage.htmpl is a form I made using detail.htmpl template and cr (Request) as the table. I directly copied the components from the tab to the new form that it should be updating. When I right-click "Operational Tab..." it takes me to the form I created, but it's not in Edit mode. When I click the "Edit" button it just takes me to the full ticket in Edit mode.



  • 11.  Re: add a new item to the "right click" options on the list_in.htmpl form
    Best Answer

    Posted 07-26-2016 06:19 PM

    Okay, here's how I got this done finally.

     

    Resultset.js

    added:

        function rsOpenTicket(persid) {

          var url=cfgCgi+

          "?SID="+cfgSID+

          "+FID="+fid_generator()+

          "+FACTORY=in"+

          "+PERSID="+persid+

          "+OP=UPDATE"+

          "+HTMPL=detail_outage.htmpl";

          popupActivityWithURL(url);

        }

     

    above function rsTransfer()

    Then in the ctxMenu area (pick where you want it I did it before ctxMenu.addItem( msgtext("Print_Form%1...",)

     

        if(propFormName=='list_in.htmpl'){

              ctxMenu.addItem("Operational...", //Operational Tab...

              "rsOpenTicket(self.activePerside)" );

     

    Made a new detail form called detail_outage.htmpl and just copied over the form elements I wanted from the tab.

     

    Hope this helps someone in the future!