CA Service Management

  • 1.  How do I put the time_spent field to be mandatory only in a certain status?

    Posted Jan 02, 2017 07:20 AM

    Hi folks, 


    I need the analysts to fill the time_spent field when a certain status transition occurs (eg when the ticket goes to the resolved status).

     

     

    I tried to create a condition for this, creating the attribute "alg.time_spent" on the object request/incident/problem and then I associated a rule for him. But, this didnt work.

     

    Any ideia how i can do it?

     

    Thanks very much, 

     

    Rafael



  • 2.  Re:  How do I put the time_spent field to be mandatory only in a certain status?

    Posted Jan 02, 2017 09:03 PM

    If you want a conditional check like this, you're probably going to need Spell Triggers.

     

    Check here for main SPL page: 

    Where can I find Spel functions documentation? 

     

    SPL code is a bit tricky to come to grips with and is an out-of-scope customisation for CA Support.

     

    Someone else may be able to give advice on a code snippet. 

    (It's probably something like a POST trigger on the Novo status field.)

     

    Thanks, Kyle_R.



  • 3.  Re:  How do I put the time_spent field to be mandatory only in a certain status?
    Best Answer

    Posted Jan 03, 2017 01:40 AM

    An alternative to a SPEL trigger could be a presave trigger on the form.

    Here's an example from detail_cr.htmpl (requests) which I have written:

     

    // Function checks that Closure Code is given while resolving (Status => "RE")
    function preSaveTrigger()
    {
      if (document.forms['main_form'].elements['SET.status'].value == "RE")
      {
        if (document.forms['main_form'].elements['SET.resolution_code'].value == "")
        {
          alert(msgtext("Closure Code is mandatory while resolving"));
          // Focus set to Closure Code field
          document.forms['main_form'].elements['SET.resolution_code'].focus();
          return false;
        }
      }
      return true;

     

    Best regards

     

    Kimmo



  • 4.  Re:  How do I put the time_spent field to be mandatory only in a certain status?

    Posted Jan 11, 2017 06:29 AM

    Hi kimmo.andersson 

     

    Thanks for you support. Its work perfeclty!! Congratulations!!!

     

    Regards, 

     

    Rafael



  • 5.  Re:  How do I put the time_spent field to be mandatory only in a certain status?

    Posted Jan 03, 2017 05:47 AM

    Hi,

    This mostly don't work (my suspicion as I don't know your condition ) because the status transition is trigger on the CR object and you are looking on a attribute of the Act_log object.

     

    You will need to create your condition to take this in consideration and this will require spl

    The presave trigger mentioned by Kimmo.andersson sound a more easy and quick solution

    /J