CA Service Management

 View Only
  • 1.  Time spent mandatory field, for to escalate, to transfer, to research and update solved status.

    Posted Mar 04, 2016 01:22 PM

    Hi community,

     

    I'm using CA SDM 14.1.02 and I have a question: ¿How I can do to set the time invested as mandatory field, for the following actions: To escalate, to transfer, to research, and update solved status in a incident ticket?

     

    I tried the following, with following results:

     

    To transfer and to escalate, I modified the "xfer_esc_cr.htmpl" in the line: <PDM_MACRO name=dtlTextbox hdr="Tiempo invertido" attr=alg.time_spent evt="onBlur='validate_duration_ts(this)'" make_required="yes" maxlength=100>, This worked for me. Good.

     

    To research, I modified the "detail_alg.htmpl" in the line: <PDM_MACRO name=dtlTextbox hdr="Tiempo invertido" attr=time_spent evt="onBlur='validate_duration_ts(this)'" make_required="yes" maxlength=100>, This does not work for me. BAD!!

     

    To update solved status, I modified "request_status_change.htmpl" in the line:

    <PDM_IF "$args.type" == "I">

    <PDM_IF "$args.status" == "RE">

    <PDM_MACRO name=dtlTextbox hdr="Tiempo invertido" attr=alg.time_spent evt="onBlur='validate_duration_ts(this)'" make_required="yes" maxlength=100> //"only this line, worked for me, but, for all states, and I just want for update the ticket to solved state. BAD!!"

    </PDM_IF>

    </PDM_IF>

     

    Note: the words in bold, italic and underlined, are what I modified.

     

    ¿Can anyone help me solve this please?

     

    Thank you very much.



  • 2.  Re: Time spent mandatory field, for to escalate, to transfer, to research and update solved status.

    Posted Mar 07, 2016 02:41 AM

    Have you tried achieving the same with a SPEL trigger on alg? You could just check the type of alg and then based on that return a fail if the time_spent is not set. I'm not sure if this will stop the check-in of the cr but at least you can try. The downside is that there is no indicator on the UI that the field is required until you try saving it.



  • 3.  Re: Time spent mandatory field, for to escalate, to transfer, to research and update solved status.

    Posted Mar 07, 2016 07:05 AM

    HI,

    In stead of spl, you can do this directly in javascript using the preSaveTrigger() if your requirements are only for the web interface.

    This trigger is called prior any save

     

    Create a sitemods.js in your /site/mods/www/wwwroot/scripts folder and add some code like below (this is just a pseudo code written on the fly so please modify,check any literals and test and test):

    function preSaveTrigger(){

    var factory;
    factory=propFactory;

    if(factory == "alg"){
    element = document.main_form.elements;
    if (typeof element['SET.type'] == "object"){
      var z_type=element['SET.type'].value;
    if (z_type == "TR" || z_type == "ST" || z_type == "ESC" || z_type == "RS"){
      if (typeof element['SET.time_spent'] == "object"){
      var z_timespent=element['SET.time_spent'].value;
      if (z_timespent == '' || z_timespent == '0'){
        var z_timespentid = element['SET.time_spent'].id;
        var z_timespenttemp = document.getElementById(z_timespentid);
        var z_errortext == "PLease enter your time spent. This is required for this type of activity";
        detailReportValidation(z_timespenttemp,true,z_errortext));
        return false
        }
      }
    }else{
    return true
    }
    }
    }

     

    Hope this help

    /J