Clarity Service Management

Expand all | Collapse all

How can I prompt that a incident ticket field is required

Jump to Best Answer
  • 1.  How can I prompt that a incident ticket field is required

    Posted 11-16-2017 05:35 PM

     

    Hi,

     

    Would like to know how can I pop a prompt to the incident ticket assignee for Priority 1 that the External System Ticket field cannot be left blank in the ticket.

    I would like it to prompt the fields need to be filled but does not stop assignee from process the incident ticket from open to closing the incident ticket.



  • 2.  Re: How can I prompt that a incident ticket field is required

    Posted 11-17-2017 06:53 AM

    Hi Guan,

     

    You can use a JavaScript, spel-code or even a <PDM_IF> around the field.

     

    The <PDM_IF> will be the easiest to implement as far as I see.

     

    ===

    Kind Regards,

    Brian



  • 3.  Re: How can I prompt that a incident ticket field is required

    Posted 11-29-2017 08:45 PM

    Hi Brian,

     

    Tried to put this in the form it doesn't trigger a message.

     

    <PDM_IF "$args.priority" == "1">
    <PDM_IF $args.external_system_ticket == "">
    showAlertMsg("External System Ticket Field is required for Priority Tickets")
    </PDM_IF>
    </PDM_IF>



  • 4.  Re: How can I prompt that a incident ticket field is required

    Posted 11-30-2017 04:34 AM

    Hi Guan,

     

    Try the following code:

     

     

    <PDM_IF "$args.priority" == "1">
    <PDM_MACRO name=dtlTextbox hdr="External System Ticket" attr=external_system_ticket keeptags=yes make_required=yes>
    </PDM_IF>

     

    P.S. Note that this will not show a popup, but the field will be similar to any other required field on the form, if the priority is set to 1.

     

    ===

    Kind Regards,

    Brian



  • 5.  Re: How can I prompt that a incident ticket field is required

    Posted 11-30-2017 09:07 AM

    Thanks Brian_Mathato!

    @GuanHua1378  - does this help you out on this?   Again its not a popup but will allow that field to behave just like any other required field, BUT it will only be enforced when the priority is set to "1".

    Let us know,
    Jon I.



  • 6.  Re: How can I prompt that a incident ticket field is required

    Posted 11-30-2017 07:12 PM

    Hi Jon,

     

    I need it to just prompt but don't enforce as required.

    If it needs to be required I could do it at classic workflow.

     

    Regards

    Guan Hua



  • 7.  Re: How can I prompt that a incident ticket field is required

    Posted 11-17-2017 02:30 PM

    If the field is required, why not set it that way in Schema Designer?

    Go into WSP, access Schema Designer, locate object "in", attribute "external_system_ticket", set the Required attribute flag, save and publish.

     



  • 8.  Re: How can I prompt that a incident ticket field is required

    Posted 11-19-2017 01:00 PM

    Hi David,

     

    The key thing here is that customer seems to want it to be conditionally required (For Priority 1 that the External System Ticket field cannot be left blank in the ticket) from what i understood, hence my slightly different options to address this and the <PDM_IF> around the field on the form being the easiest in my opition. Making the field required at the schema as you suggested will make it required for all cases and not validated if the case is P1 or not.

     

    ===

    Kind Regards,

    Brian



  • 9.  Re: How can I prompt that a incident ticket field is required

    Posted 11-20-2017 01:59 PM

    You can add function preSaveTrigger2(){...} to that page. And in the function you add your logic to it(prompt for required fields etc).



  • 10.  Re: How can I prompt that a incident ticket field is required
    Best Answer

    Posted 12-01-2017 04:14 AM

    Hi Chi Chen,

     

    I put the logic in the preSaveTrigger2() with below.

     

    var mypriority=document.getElementById("df_0_4");
    var myoptionSelected=mypriority.options[mypriority.selectedIndex].text;
    var myExternalTicketSystem=document.getElementById("df_4_3").value;
    if ( myoptionSelected=="1" && myExternalTicketSystem=="" ) {
    alert("External Ticket System is required when Ticket priority is 1");
    } else {
    alert("Ticket priority is " + myoptionSelected);
    }

     

     

    Since this function is trigger on save action,

    I would also like to know where I could place code to trigger when user press the edit option.



  • 11.  Re: How can I prompt that a incident ticket field is required

    Posted 12-01-2017 09:16 AM

    That looks good, Guan Hua. As for the "Edit" button code insertion/modification, please start start a new community post. They need different approaches. Thanks _Chi



  • 12.  Re: How can I prompt that a incident ticket field is required

    Posted 11-27-2017 10:29 AM

    Hi GuanHua1378 - did the info from Brian and Chi help you out here?