CA Service Management

Expand all | Collapse all

gobtn_role.htmpl Modifications

  • 1.  gobtn_role.htmpl Modifications

    Posted Mar 20, 2015 01:51 AM

    Hi Team,

     

    In CA SD we have an option to search for incident/requests/change tickets etc, which is in the top right corner of the page.(PFA screenshot).

    The problem I'm facing here is, whenever I enter a ticket id I can't determine if its request or incident ticket. So, for this I have to select "incident" or "request" from the

    object type selection drop-down box. I want to modify the drop down option and combine Incident & Request as a single option. Can sum1 suggest me to do this?

    Also, can someone let me know how to change the ticket id series for Request & Incident(like Incident starts from Ixxxxx and Request from Rxxxx). I have tried sequence number option but it doesn't help.

     

    role.jpg



  • 2.  Re: gobtn_role.htmpl Modifications

    Broadcom Employee
    Posted Mar 20, 2015 06:16 PM

    What version of CA SDM do you have installed?

     

    I recall that this was a very popular enhancement request a little while ago



  • 3.  Re: gobtn_role.htmpl Modifications

    Posted Mar 23, 2015 12:37 AM

    Hi Paul,

     

    The version is r12.5. Any idea how to achieve this?



  • 4.  Re: gobtn_role.htmpl Modifications

    Posted Mar 23, 2015 04:35 AM

    For the ticket reference numbers you can achieve this with a SPEL trigger. Can't check it now but I think you'll want a PRE_VALIDATE trigger for insert. Then just prefix it with the code of the ticket or implement more advanced logic. If you wish to save the original ref_num you can create a custom attribute where you save it before modifying the visible one.

     

    For the Go resource, you'll want to create a custom factory for the cr object that doesn't restrict the type of the ticket in any way. After that, create a new web form where you reference the custom factory. Other than that it's just a copy from the go resource you already have on the requests.

     

    I hope you're able achieve your goal with these tips.



  • 5.  Re: gobtn_role.htmpl Modifications

    Posted Mar 23, 2015 09:44 AM
      |   view attached

    Here is a wiki link that details how to customize the Go Button. I think it works for R12.5....  www.servicedeskusers.com/R12_Go_button_Search_Customization. R12.6 - 12.9 customization is slightly different and I have attached the documentation for those release.

     

    Ny Tillman

    Attachment(s)

    zip
    GO_Button_R12-6_to_R12-9.zip   364 KB 1 version


  • 6.  Re: gobtn_role.htmpl Modifications

    Posted Mar 23, 2015 10:35 AM

    Yep, this is exactly what I meant, I just didn't know someone had documented it.



  • 7.  Re: gobtn_role.htmpl Modifications

    Posted Mar 25, 2015 03:25 AM

    Hi Tillman,

     

    Thanks for the code!! I'll try and let u know.. Meanwhile can u help me on using prefix before the incident and request numbers?(jus for my understanding)



  • 8.  Re: gobtn_role.htmpl Modifications

    Posted Mar 25, 2015 03:32 AM

    You mean you tried the solution I gave you and it didn't work? It should work, it's been in use for more than five years and works fine.



  • 9.  Re: gobtn_role.htmpl Modifications

    Posted Apr 29, 2015 03:17 AM

    Hi Tillman,

     

    thanks for the documentation! I am not familiar with the WSP and have some trubble to create the content of the detail_zrip.htmpl and list_zrip.htmpl.

    Does anyone have these files and can share it?

     

    Is there a possibility, that for example an Incident opens in the detail_in.htmpl if i enter the incident ticketnumber insted of open the ticket in the detail_zrip.htmpl by searching "Any I/R/P Ticket"?

     

    Thanks!

    Alex



  • 10.  Re: gobtn_role.htmpl Modifications
    Best Answer

    Posted Mar 25, 2015 09:25 AM

    ManishaP

     

    Just expanding on Jussi's solution to add the prefix with the steps I've used

     

    1. Add a SPEL trigger to a \\NX_ROOT\site\mods\majic\ *.mods file (you need to create the mod file or use an existing site defined one). E.g. MODIFY cr POST_VALIDATE zcreate_prefix(ref_num, type) 117 FILTER(EVENT("INSERT"));

    NOTE:  I'm using POST_VALIDATE... you can use PRE_VALIDATE

     

    2. Add the SPEL method that the trigger calls to a \\NX_ROOT\site\mods\majic\*.spl file

    //member method that adds a prefix to the cr ticket number
    cr::zcreate_prefix(...) {
        string ticNum, ticType, zmethod;

        zmethod = "cr::zcreate_prefix()";

        ticNum = argv[3];
        ticType = argv[6];

        if(ticType == "I") {
            ticNum = format("I-%s", ticNum);
        } else if(ticType == "P") {
            ticNum = format("P-%s", ticNum);
        } else if(ticType == "R") {
            ticNum = format("R-%s", ticNum);
        }

        send_wait(0, this, "call_attr", "ref_num", "set_val", ticNum, "SURE_SET");
        if (msg_error()) {
            logf(ERROR, "%s: Unable to modify ref_num value", zmethod);
            return;
        }
    }

     

    3. Recycle services and test



  • 11.  Re: gobtn_role.htmpl Modifications

    Posted Mar 30, 2015 06:29 AM

    Hi Nyet,

     

    That code did work fine... thanks a lot!!.. But can you let me know, when you say

      ticNum = argv[3];

      ticType = argv[6];

     

    How did you determine index 3 of the argv array contains ticket number?

    What all details are present in the argv array. How can I determine which index to  be used if i have to refer to other parameters?

     

    Pls note I'm amateur in the spl side, hence such questions .. Kindly help...also if you have any reference guide for spel coding, it would be great!



  • 12.  Re: gobtn_role.htmpl Modifications

    Posted Apr 09, 2015 07:50 AM

    Hi ManishaP,

     

    I too am an amateur in SPL code. When I started working with SDM a long time ago I tried printing out the argv array elements to see what was in the list. The number of arguments in the array depends on the parameters in the trigger. From trial and error I figured out that each parameter has 3 elements in the array that refers to that field. So if the trigger had only 1 parameter:

    argv[0] - I think is the index of how many elements are in the array. I can't recall right now.

    argv[1] - can't recall right now but I think it was the field name

    argv[2] - the old value in the field (I'm sure of that )

    argv[3] - the new value in the field. (If the field wasn't updated argv[2] and argv[3] will be the same)

     

    So because the trigger above has 2 parameters (ref_num, and type) the argv array index was 7.

     

    Hope that helped a bit.

     

    I have no references for SPL code. Contributions from users in servicedeskusers.com and helpdeskusers.com helped a lot and the rest is just typing c++ code to see what doesn't trigger errors in SDM. I use printf statements a lot to see console information when I'm trying to figure out stuff in SPL. Also as newer versions are released there's less need for SPL code.

     

    Ny



  • 13.  Re: gobtn_role.htmpl Modifications

    Posted May 05, 2015 03:49 AM
      |   view attached

    Hi everybody,

     

    used the GO_Button_R12-6_to_R12-9.zip documentation and created the htmpl files.

     

    - the gobtn_role.htmpl has a modification to search for tickets without the prefix. so you can enter only a number

    - the list_zrip.htmpl shows the results in a list

    - the detail_zrip.htmpl redirects the to the corresponding detail_xx.htmpl of the ticket

     

    I just want to share my work

     

    regards

    Alex

    Attachment(s)

    zip
    gobtn_htmpls.zip   5 KB 1 version