Set Task to High Priority depending on the Catalogue Item Using No Script?

Harry Smith
Giga Contributor

Hi Community,

 

Is there a way to set a REQ/RITM/Task to a P.2 depending on the catalogue item the REQ was created off of without using any scripting?

 

Preferably without a business rule too but not a problem if I'll be required to use one.

 

Many Thanks,

 

Harry Smith

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Harry Smith 

There are different ways to do this

1) Workflow of your individual catalog item

OR

2) Before insert BR on sc_request, sc_req_item, sc_task table

OR

3) Assignment Rule - Remember you will have to do this setup for every Table (REQ, RITM, TASK) for every catalog item - Somewhat lengthier method

Workflow approach - I would suggest this as it would be specific to your catalog item

yes you can set it via run script of workflow

 

if(current.cat_item.name == 'Catalog Item1'){

current.priority = 2;

current.update(); // updates RITM

var req = current.request.getRefRecord();

req.priority = 2;

req.update();

}

You can set it during catalog task creation as well if you are using the Catalog task activity

 

if(current.cat_item.name == 'Catalog Item1'){

task.priority = 2;

}

Regards
Ankur

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

View solution in original post

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

@Harry Smith 

There are different ways to do this

1) Workflow of your individual catalog item

OR

2) Before insert BR on sc_request, sc_req_item, sc_task table

OR

3) Assignment Rule - Remember you will have to do this setup for every Table (REQ, RITM, TASK) for every catalog item - Somewhat lengthier method

Workflow approach - I would suggest this as it would be specific to your catalog item

yes you can set it via run script of workflow

 

if(current.cat_item.name == 'Catalog Item1'){

current.priority = 2;

current.update(); // updates RITM

var req = current.request.getRefRecord();

req.priority = 2;

req.update();

}

You can set it during catalog task creation as well if you are using the Catalog task activity

 

if(current.cat_item.name == 'Catalog Item1'){

task.priority = 2;

}

Regards
Ankur

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

Hi Ankur

 

Could please help me with "How to Navigate to Run Script"?

Thanks

Abhishek Pandey

Abhishek Pandey
+91 7869881249 || 120591abhishek@gmail.com

you can use Run Script activity from workflow editor

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

Hi Ankur.

Thanks for getting back!

I checked it but that option is not available for me though I have Workflow admin role.

not sure what i am missing here. Also, Can't this be achieved via. Client Script for specific catalog?

 

Regards

Abhishek Pandey  

find_real_file.png

Abhishek Pandey
+91 7869881249 || 120591abhishek@gmail.com