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
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

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

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/atul_grover_lng [ 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.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

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/atul_grover_lng [ 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 ?