CA Service Management

  • 1.  How to show a message on successful save of the ticket

    Posted 11-30-2016 05:19 AM

    I want to a show message after the ticket is saved. same as " Save Successful - Request xx *** updated " .  

    I have tried from

    • .spl but unfortunately , we can invoke message when the condition fails so, this is the case I want to send a message UI when the ticket is saved.
    • Tried with preSavetrigger()  function, this function invokes before save and the message is shown in UI but the ticket is failed to save.

    any idea how to show the message once the ticket is saved  and successful . for example once the ticket is saved in UI will get the message as   "

    for example, once the ticket is saved in UI will get the message as   "Save Successful - Request xx *** updated" 



  • 2.  Re: How to show a message on successful save of the ticket

    Posted 11-30-2016 07:03 AM

    But there is allready similar message after ticket is saved e.g.

     

     

    Do you wan't to change it somehow



  • 3.  Re: How to show a message on successful save of the ticket

    Posted 11-30-2016 07:27 AM

    I want to show the additional message to a specific tenant as

    "  The callback  date of the request has been automated to next 48 hours, if you want to change please edit and change to the desired date."

     

     



  • 4.  Re: How to show a message on successful save of the ticket

    Posted 11-30-2016 08:17 PM

    It is easy if you are ok that message will be shown always if some criteria satisfied. For example here is how we show message if attachment is attached to ticket

    if ($args.attachments.length > 0 && "$prop.form_name_3" != "edit") {
     docWriteln('<table id="alertmsg" class="alertmsg" style="display: block;"><tbody><tr><td id="alertmsgText">This $args.type.sym has $args.attachments.length attachment(s)</td></tr></tbody></table>');
    }

     

    If you wan't to do this just one time when ticket is saved - you can create some local string field and set it to some value when your automation accure. Next time ticket will be refreshed the value will be gone as well as message



  • 5.  Re: How to show a message on successful save of the ticket

    Posted 12-01-2016 10:15 AM

    I have found the way to show the message as below once the ticket is saved. This is message is shown to user for every update of the ticket.

     

    Is there a way to show the message only when the initial save of the ticket (newly created tickets only, not for updates) ?

     

    if ("$prop.form_name_3" != "edit") {

    ahdframe.AlertMsg = ahdframe.AlertMsg + "<br>" + "Request Tickets are opened with a default 'Requested Completion Date' set for the next 48 hours in Service Desk. If you need to change the 'Requested Completion Date', you can do so by changing the date after the ticket is saved";

    }



  • 6.  Re: How to show a message on successful save of the ticket

    Posted 12-01-2016 04:36 PM

    As i said you need to:

    1. Create Local String attribute

    2. Creta trigger that on insert will fire spel that will set value for that attribute

    e.g. for cr:

    OBJECT cr {
      ATTRIBUTES Call_Req {
        zinitial  LOCAL STRING ; // initiated from TR LOG ST activity
      };
      TRIGGERS {
      PRE_VALIDATE zset_local() 4014 FILTER(EVENT("INSERT"));
        };
    };

    and here is example of spel code:

    zset_local(...)

    {

     uuid who; 

      send_wait(0,top_object(), "call_attr""cnt""current_user_id");  

      who=msg[0];  

      send_wait(0, top_object(), "call_attr""api""update_object_super", who, persistent_id, 0"zinitial ", "1");  

    }

     

    Since attribute is local it will have value only when ticket is saved for the first time

    if ("$prop.form_name_3" != "edit" && $args.zinitial  != "") {

     

    ahdframe.AlertMsg = ahdframe.AlertMsg + "<br>" + "Request Tickets are opened with a default 'Requested Completion Date' set for the next 48 hours in Service Desk. If you need to change the 'Requested Completion Date', you can do so by changing the date after the ticket is saved";

     

    }