- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2025 03:31 AM - edited 08-06-2025 03:42 AM
Hello All ,
I try to abort execution of Scheduled Job when other scheduled Jobs (from a list ) are running. Script works in Background but there is no query to v_cluster_transaction table in Scheduled Job
my script :
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2025 03:41 AM
@Marcin Witoslaw verify a link: Solved: Script to get active transactions from all nodes t... - ServiceNow Community
it specifies and query v_cluster_transaction from Scheduled Job
if this response helps you, then mark helpful and accept as a solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2025 05:15 AM
Still the same unfortunatelly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2025 05:38 AM
Use this revised script:
var result = false;
for (var i = 0; i < scheduledJobs.length; i++) {
var jobName = scheduledJobs[i];
if (!jobName || jobName === currentJobName) {
result = true;
continue;
}
var clusterGr = new GlideRecord("v_cluster_transaction");
clusterGr.addQuery('url', 'CONTAINS', jobName);
clusterGr.query();
if (clusterGr.hasNext()) {
result = true;
break;
}
}
return result;
Make sure these variables are properly initialized before this script runs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2025 06:15 AM
Thank you @Nilesh Pol for a quick response but no luck still the same.