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

Hi,

you need to open the checked out workflow

then in right side under core you can see run script

Regards
Ankur

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

Thanks Again Ankur,

I am getting below screen, still no luck to get 'Run Script' is it something to do with plugin or licensing?

find_real_file.png

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

there are no workflows which are checked out by you.

For your testing you can open published workflow, check that out and then you should see the Run Script activity

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

Hemanth M1
Giga Sage
Giga Sage

Hi, 

you can try using assignment rule if you want to go with no/low code option:

 

please  refer : https://docs.servicenow.com/bundle/london-it-service-management/page/product/incident-management/tas...  

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

Ankur Bawiskar
Tera Patron
Tera Patron

@Harry Smith 

Hope you are doing good.

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

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