We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Changing priority if Description contains the word Outages, severe or critical

Teteziho
Tera Contributor

hi i wanna know how could I change the priority with a client script if description contains the word Severe , outages or critical. I think I need to use indexOf but I don't know how.

5 REPLIES 5

Dr Atul G- LNG
Tera Patron

Hi @Teteziho 

 

Don't change priority directly, change impact and urgency , which auto calculate the priority for you. 

 

Client script on change

 

If Short description contains Outage

Set Urgency

Set Impact

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Teteziho
Tera Contributor

whats are the index for impact and urgency ? to put priority on p1 can you send me an code exemple 

 

Hi @Teteziho 

 

Priority is already a read-only field & it will be populated based on the impact & urgency.

 

If impact == 1 & urgency == 1 then priority will be 1.

 

https://www.servicenow.com/community/now-platform-forum/set-state-value-from-a-client-script/m-p/126...

 

Baseline code.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Teteziho
Tera Contributor

 but basically I need to use a condition that can look If my description contains one of the 3 words I mentioned above and In client script you can't use contains but IndexOf how could I use the condition ?