Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to set Priority based on Category field?

Mytno1
Mega Contributor

So, it is like I have 1 category and 5 subcategory, each element in subcategory have a different value (1 or 2 or 3, it just like urgency and impact but it is subcategory) and these wil be used to calculate the priority field. I'm new to SN so I don't know much, How should I do it? Thank you.

If possible, may you show me how should I do it in detail? Like where to go, coding.. etc

Thanks

1 ACCEPTED SOLUTION

Here is the screenshot for your reference

find_real_file.png

Mark correct and helpful if this solves.

View solution in original post

15 REPLIES 15

Thanks, I got it.

2 more question, how should I use category and subcategory to chảng the priority pls? I tried the script above but i did't work, here is my code:

 

if(newValue == 'network' && (g_form.getValue('subcategory') == 'dns')){
	   g_form.setValue('state',3);
	g_form.setValue('priority', 2);
   }

 

And if I create another field (EX: field [important] of Category and [important] of subcategory) how should I do to get the average of these [important] field?
I plan to set them as all number running from 1-5, and their average value shall be use to calculate the priority field.

I cannot get the category and subcat to 1-5 number since I have plan for them, how should I do? 

tks very mucjh.

 

RicardoH
Tera Expert

Hello,

 

Check this article in Docs.

 

Hope it helps you!

Mytno1
Mega Contributor

Hi, tk.

I'm doing this and i'm wondering how should I do sth like this?

find_real_file.png

I want it so when I chose the category = Test001 and impact == 1 so the prority equal 1 as well.

Sth like this, how should I make the final code work? I donno much about java script.

thank you very much

Hi,

To check the category as Test001 and impact as 1 use the following if condition in your onchange function

 

if (newValue == "Test001" && g_form.getValue("impact")==1) {

g_form.setValue("priority",1);  

}

 

Mark correct and helpful if this solves.

Truong Hoang
Kilo Contributor

I'm doing this and i'm wondering how should I do sth like this?

find_real_file.png

I want it so when I chose the category = Test001 and impact == 1 so the prority equal 1 as well.

Sth like this, how should I make the final code work? I donno much about java script.

thank you very much