Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Using workflows to prevent RITM closure

ShaziyaS4380655
Tera Contributor

Hi Community

 

i want to prevent RITM closure if it has any open tasks can this be achieved using Workflows , i can't use BUsiness rules into my instnce

1 REPLY 1

Vishal_Jaiswal
Mega Guru

Hi @ShaziyaS4380655 ,

 

For best practice, you should use Business Rule, but as you said, you don't have access to that, so please follow the approach below.

1) Add an activity "Wait for condition" in your existing workflow and use the below script.

var answer = true;
var grTask = new GlideRecord('sc_task');
grTask.addQuery('request_item', current.getUniqueValue());
grTask.addQuery('active', true);
grTask.setLimit(1); 
grTask.query();

if (grTask.hasNext()) {
    answer = false; 
}

 

If my answer is useful, then mark it helpful or accept the solution.

 

Regards,

Vishal