CA Service Management

 View Only
Expand all | Collapse all

Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

  • 1.  Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Jan 11, 2016 03:45 AM

    Hello All,

     

    CASD12.7

     

    We are in need of closing bulk tickets in CASD of type-Req/Inc/Prob/RFC but while closing the bulk tickets we would like to insert some comments in the logs for the audit. Is ti possible using the (pdm_load/pdm_userload) however how we can use the comment in input file also please suggest on the best practices if any.

     

    Regards,

    Mohan



  • 2.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Jan 11, 2016 07:46 AM

    Perhaps consider doing this via webservices. This will in my opinion be more efficient than using load utilies



  • 3.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Jan 12, 2016 01:40 AM

    Hi Brian,

     

    Thanks for the response. Can you please help on how it can be achieved via webservices.Any sample format/code  will be better. Thanks in advance.



  • 4.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Jan 12, 2016 02:16 AM

    In the $NX_ROOT\samples\sdk\websvc\java\test2_basic folder you get a sample Java program that creates a Request and updates it. You could use it as a starting point to create a program that will update the Requests you need.



  • 5.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)
    Best Answer

    Posted Jan 12, 2016 09:07 AM

    You can use bop_cmd.

    1. On SDM server create bulk.frg file with the following content

     

    void bulkclose(string comment,...)
    {
    int i;
    if (argc > 1)
    {
    uuid who; 
    send_wait(0,top_object(), "call_attr", "cnt", "current_user_id"); 
    who=msg[0]; 
      for (i=1;i<argc;i++)
      {
      send_wait(0, top_object(), "call_attr", "api", "generic_status_change", who, argv[i], comment, "crs:5201"); 
       if (msg_error()) { 
         logf(ERROR,"Error %s",msg[0]); 
       }
      }
    }

    }

     

    2. execute the folowing command or make the bat file with the following content

    bop_cmd -g -v -u ServiceDesk -f %~dp0/bulk.frg bulkclose("my comment here,cr:402125,cr:402266")

     

    first parameter is your comment, and then persistent_id's of the tickets to close.

     

    You can also change my spel to accept ref_num's instead of persistent id's and pass them as parameters to bat file, but that is diferent story



  • 6.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Jan 13, 2016 06:22 AM

    Hi Gutis,

     

    Thanks much for the code. I have few doubts, please clarify.

    1. Please tell where the .frg file needs to be placed just like any folder and navigating to that folder execute the bop command.

    2. Is there any thing that needs to be taken back-up or any precautionary methods needs to be a carried out before executing the command.

    3. Also, advise on  amount of ticket can be closed in bulk/allowable level I can include in this script so that it won't affect the performance of production environment.



  • 7.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Jan 13, 2016 06:15 PM

    1. You can place it anywhere on the server

    2. This script from my opinion is more safer than pdm_load utilities, since it works with object layer instead of database so all constrains will be in place to ensure data integrity, also be aware that all triggers, notifications and events will be executed as configured in system on ticket close.

    3. This is something that you should test on your testing system.



  • 8.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Jan 19, 2016 12:09 AM

    Hi Gutis,

     

    Thanks for the valuable code, it is working as expected.

     

    Regards,

    Mohan



  • 9.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Jan 19, 2016 03:32 AM

    You're welcome



  • 10.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Jan 27, 2016 05:59 AM

    Hi Gutis,

     

    Thanks for your earlier help. Is it possible to close the bulk RFC by modifying the above code.

     

    Regards,

    Mohan



  • 11.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Jan 27, 2016 06:27 AM

    Yes, you need just change status persid.



  • 12.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Jan 27, 2016 06:35 AM

    I have executed the below but no go :

    bop_cmd -g -v -u ServiceDesk -f %~dp0/bulk.frg bulkClosed - Successful("closed due to in-activity,chg:xxxx").



  • 13.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Jan 27, 2016 07:37 AM

    You need to change code,

     

     

     

    void bulkclose(string comment,...)
    {
    int i;
     if (argc > 1)
     {
     uuid who;  
     send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");  
     who=msg[0];  
      for (i=1;i<argc;i++)
      {
      send_wait(0, top_object(), "call_attr", "api", "generic_status_change", who, argv[i], comment, "chgstat:6001");  
      if (msg_error()) {  
        logf(ERROR,"Error %s",msg[0]);  
      }
      }
     }
    }
    

    you may also improve code to automaticaly detect from object persid wich status to use



  • 14.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Feb 05, 2018 01:44 PM

    Hello Gutis,

     

    We have the same requirement as above, But the above code didnt worked. Can you please help me on the same

     

    Thanks

    Prem



  • 15.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Mar 21, 2018 06:00 AM

    Hi Vikky,

     

    We are facing the same issue, is there any other solution which can help to solve the bulk closure issue as mentioned above.

     

    We have also tried the above code but its not working for us also.



  • 16.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Mar 21, 2018 06:18 AM

    Hello Gutti,

    Do we have to compile the bulk.frg file.



  • 17.  Re: Log comment while closing bulk tickets in backend(pdm_load/pdm_userload)

    Posted Mar 22, 2018 03:36 PM

    No, and I do not know how to compile spel code