Using workflows to prevent RITM closure
						
					
					
				
			
		
	
			
	
	
	
	
	
Options
			
				
					
	
			
		
	- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
yesterday
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
	
		
		
			
			
			
					
	
			Options
			
				
					
	
			
		
	- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
yesterday
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
