CA Service Management

Expand all | Collapse all

Different message when incident is saved successfully

  • 1.  Different message when incident is saved successfully

    Posted Jan 03, 2018 09:49 AM

    Hi Team,
    if an incident is saved successfully I want to show a different message depending on a condition.
    I defined a new attribute which manually gets a certain code. If one or more active incidents with this code already exist, the incident must be saved, but another message than ...successfully... must be displayed.
    Do you know a solution for my question.
    Regards Baerbel



  • 2.  Re: Different message when incident is saved successfully

    Posted Jan 03, 2018 10:50 AM

    Hi Baerbel, 

    I dont believe this is possible out of the box.  The messaging is hard coded and is global - there are no triggers to show different messages upon saving based on a condition.  This would require custom spelcode as well as some possible javascript code too.

    Has anyone out there done something like this??

    Jon



  • 3.  Re: Different message when incident is saved successfully

    Broadcom Employee
    Posted Jan 03, 2018 11:05 AM

    Hello,

     

    Can you provide a use case?  As Jon pointed out, the save message for an incident is pretty much hard coded and cannot be modified to behave conditionally.  I am curious to what you are trying to do, why you need a specific message to appear when saving the incident depending on the incident attributes.



  • 4.  Re: Different message when incident is saved successfully

    Posted Jan 03, 2018 11:33 AM

    Hi Team,

    the user must get an information if more than one incident for the specified local code already exist. In this case it is a code for a printer like a serial number, and the user must know of the additional Incidents.  This message also can pop up when the incident is shown after it was saved successfully. Is such a solution possible?

    Regards Baerbel



  • 5.  Re: Different message when incident is saved successfully

    Broadcom Employee
    Posted Jan 03, 2018 01:31 PM

    Hello Baerbel,

     

    The nearest thing I can think of trying is to do an Activity Notification which would check for the given code value and if the code value assesses correctly, have a notification sent out.  It could be a mail notification or if you want to get creative, try a remote reference action which Service Desk would kick off instead of a mail action; the given action would alert the user some other way in place of an alternate save message, like a pager mail or a message sent to the user's computer as a pop up.  

     

    Note:  Further development of this solution may potentially require further customisation work through Services, similar to the spel code/javascript option that was previously mentioned.



  • 6.  Re: Different message when incident is saved successfully

    Posted Jan 03, 2018 04:40 PM

    Hi,

     

    As for the yellow banner, I believe there is no way to accomplish this. But, it might be possible to get something similar with a lot of work. You would need to grab a list for all tickets with that same code and if the list is great than 1, you can thrown an alert. This is the only thing I can think of. There might be a function to do throw the yellow banner too but, all of this is already outside the scope of what is supported.



  • 7.  Re: Different message when incident is saved successfully

    Posted Jan 04, 2018 07:19 AM

    out of support from CA but must not be difficult to accomplish that by modifying the msg_catalog.

    this is a pure js.file so you can code your logic directly there and overwrite default using the msg_cat_site.js file that you will put inside your site/mods.

    In your case the message you are looking for is mostly: __messages["Save_Successful"]="Save Successful";

    Then you will create your logic there something like the pseudo code below that you can extend to match your needs.

     

    //retrieve the associated incident list

    <PDM_LIST ESC_STYLE=JS2 PREFIX=listprinterticket FACTORY=in WHERE="delete_flag=0 and z_printer_code= $args.z_printer_code">

    </pdm_list>

    var zTicketLength = listprinterticket.length;

    if (type == "I" && zTicketLength >1 ){

       __messages["Save_Successful"]="Warning there is already tickets for the same printer!";

    }

    else{

       __messages["Save_Successful"]="Save Successful";

    }

    the only downside  I see with this approach is that the list returned will be the one at the time the page is loaded (preprocessor engine).

    Then if someone create a ticket with this attribute in between you save, this will not be taken in consideration.

    Hope this help,

    /J



  • 8.  Re: Different message when incident is saved successfully

    Posted Jan 05, 2018 02:03 PM

    Hi Jeroeme,

     

    I tried your solution, but no success. I copied msg_cat_site.js to C:\Program Files (x86)\CA\Service Desk Manager\site\mods\www\wwwroot\scripts, copied your code and changed it using my local attribute zTA_StellPlatz_Nr, now it looks like this
    <PDM_LIST ESC_STYLE=JS2 PREFIX=listprinterticket FACTORY=in WHERE="delete_flag=0 and zTA_StellPlatz_Nr=$args.zTA_StellPlatz_Nr">
    </pdm_list>
    var zTicketLength = listprinterticket.length;
    if (type == "I" && zTicketLength >1 ){
       __messages["Save_Successful"]="Warning there is already tickets for the same printer!";
    }
    else{
       __messages["Save_Successful"]="---Save Successful---";
    }

     

    I did change the successful message ("---Save Successful---") to be sure that the code is executed, but the default message is shown.
    In my case it is a German system and of course the German message is shown.

    Do you know what is perhaps missing?

    Regards
      Baerbel



  • 9.  Re: Different message when incident is saved successfully

    Posted Jan 08, 2018 02:47 AM

    HI Veiba,

    In fact did that out of my head with no looking.

    I did have a closer look to the msg_cat and in fact the correct message for created and updated are:

    __messages[920]=" -%1%2 created";
    __messages[921]=" -%1%2 updated";

    Then you would like to modify those one in the same principle.

    You can keep the %1%2 in it for the factory and ref_num to be be populated automatically.

     

    Hope this help,

    /J



  • 10.  Re: Different message when incident is saved successfully

    Posted Jan 10, 2018 01:59 PM

    Hi Jeroeme,

    I did some tests, but it does not work, I think the PDM_LIST does not work in msg_cat.js. I do not see any error message, but the original msg_cat.js is used. If I change the message without using PDM_LIST I see my modified message, but of course always when I create a new Incident. I did try it directly in detail_in.htmpl but it also does not work.
    At the moment it seems that the only possibility is to realize it as Pier-Oliver suggested.

    Regards
       Baerbel



  • 11.  Re: Different message when incident is saved successfully

    Posted Jan 05, 2018 03:02 AM

    Hi Jerome,

    thank you for your suggestion, I will test it as soon as possible and let you now the result.

    Regards Baerbel



  • 12.  Re: Different message when incident is saved successfully

    Posted Jan 05, 2018 11:31 AM

    I did something similar in the past, here how it was working :

     

    User create a ticket

    Tries to save it

    SPEL code validate some condition and write 1 to a custom field no matter if the SPEL founds related incidents. (This means that the validation has already been done)

    if incidents have been found

       SPEL returns false

       SPEL returns an error message with the related incidents.

       If user wants to save anyway, he click save again.

       SPEL code does not validate condition because the custom field has now a value of 1.

    if no incidents have been found

      SPEL returns true