On hold comments required

Cat
Tera Guru

Hi All,

 

I have a UI Policy which makes the additional comments field mandatory for tickets assigned to the Service Desk:

Cat_0-1779187092711.png

I also have a Business Rule, which sets the ticket state to "In Progress" when the assignment changes from or to the Service Desk:

Cat_1-1779187272718.pngCat_2-1779187301233.png

The issue I'm having is that if a ticket is set to On Hold Awaiting caller and assigned to, say, Infrastructure Team, it still forces them to fill in the additional comments if they are assigning it to the Service Desk, even though it then changes the state to In Progress once saved (therefore not requiring additional comments).

 

Is there a way for me to change this so it can do what I want to achieve? There may not be a way, but thought I'd ask the question. This scenario is unlikely to come up anyway!

12 REPLIES 12

It is working with the setting I shared. When I had the UI policy ticked, it worked exactly the same as it did when I had it as a UI Policy, so I was back to square one. 

 

Ankur Bawiskar
Tera Patron

@Cat 

my thoughts

-> Keep the Business Rule that changes state when assignment changes to or from Service Desk.

-> Change the Additional comments requirement so it only applies when the record is actually in the state that truly needs comments

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@Cat 

Did you try above?

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

No because I'm not sure where I would do that - how can I specify when it *actually is* in that state beyond what I have shared in my screenshots?

Do you have an example?

Tanushree Maiti
Tera Patron

Hi @Cat 

 

Option1 (Recommended): You can alter the conditions of your UI Policy to only trigger the mandatory requirement when the ticket is NOT in the "On Hold" state. 

  • Navigate to System UI > UI Policies and open your policy.
  • Add  filter condition:
    • [Assignment group] is [Service Desk]
    • AND [State] is not [On Hold]  //Update condition as per your requirement
  • Save the UI Policy

Option2 : 

  1. Create a onChange Client Script
    • Table: incident 
    • Type: onChange
    • Field name: Assignment group 

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {

    if (isLoading || newValue === '') {

        return;

    }

    var serviceDeskSysId = '<Service_Desk_Sys_ID>';

    var currentState = g_form.getValue('state');

    if (newValue == serviceDeskSysId && currentState == '3')  //Update the state as per your requirement

    {

        g_form.setMandatory('comments', false);

    }

   else if (newValue == serviceDeskSysId)

   {

        g_form.setMandatory('comments', true);

    }

}

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti