background script to identify particular assignment group in all workflows and flow designers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2024 11:07 AM
Hi
I need to identify the workflows and flow designers that are using particular assignment group- through background script. If anybody has the script kindly help here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 11:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 02:27 PM
For Flow, it's harder because of the way ServiceNow stores it, but it IS stored. This is something similar I used:
findGroups();
function findGroups(){
var assignGroup = '';
var getGroups = new GlideRecord('sys_variable_value');
getGroups.addEncodedQuery('document!=wf_activity^ORdocument=NULL^document=sys_hub_action_instance^variableSTARTSWITHfiel^valueLIKEassignment_group=');
getGroups.query();
while(getGroups.next()){
varSplit1 = getGroups.value.split(":");
//varSplit2 = varSplit1[1].split(',');
assignGroup = varSplit1[1];
var getFlow = new GlideRecord('sys_hub_action_instance');
getFlow.get(getGroups.document_key);
gs.info('Flow: '+getFlow.flow.getDisplayValue()+" uses assignment group: "+assignGroup);
}
}
Be sure to change the StartsWith query to a Contains if you can't guarantee it's the first field set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 12:39 PM
Has anyone tried this? I have the same question.
We need a script that, using an assignment group, returns all the flows where it is used.
We queried the sys_hub_flow_component , sys_hub_action_instance_v2 , sys_variable_value tables, but were unable to obtain that data.
thanks!