Task Priority should be populated according to the RITM Priority

Mallika Bhupath
Tera Contributor

Hi all,

Currently the RITM and Task priority is set to None. However, when a manager decides to select either a priority of 1,2,3 0r 4 on the RITM, the same priority has to be reflected on the Task. 

We have multiple catalog items therefore changing the workflow would be tedious.

I have tried using the business rule too but it does not seem to work.

Any help will be appreciated.

Thanks,

Mallika

1 ACCEPTED SOLUTION

vkachineni
Kilo Sage
Kilo Sage

The BR should run on "sc_req_item" on update when priority changes.

 

find_real_file.png

Add your items in the filter along with priority filters

find_real_file.png

var scTaskGR = new GlideRecord('sc_task');
scTaskGR.addQuery('request_item', current.sys_id); //load the sc tasks. There could be multiple.
scTaskGR.query();
while (scTaskGR.next()) {
	scTaskGR.priority = current.priority;
	scTaskGR.update();
}

 

 

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

View solution in original post

13 REPLIES 13

vkachineni
Kilo Sage
Kilo Sage

The BR should run on "sc_req_item" on update when priority changes.

 

find_real_file.png

Add your items in the filter along with priority filters

find_real_file.png

var scTaskGR = new GlideRecord('sc_task');
scTaskGR.addQuery('request_item', current.sys_id); //load the sc tasks. There could be multiple.
scTaskGR.query();
while (scTaskGR.next()) {
	scTaskGR.priority = current.priority;
	scTaskGR.update();
}

 

 

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

Hi @vkachineni ,

 

I have over 100 catalog items. How can I modify the script without loading the sc tasks?

 

Thanks,

Mallika

If you do not put any filter on the BR for item, it will run for all items.

How do you identify whether the priority copy should run for a catalog item? What is your selection criteria for over 100 catalog items?

 

 

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

Is there any other way this can be done? Because  updating the workflows would be a long process. Unfortunately according to the requirement, there is no selection criteria. The process owner wants the task priority to be populated if the RITM is changed.