- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2013 03:06 PM
Is there a way to search the various script fields in workflow activities? I need to verify the use of certain table/field uses in workflow activity scripts.
For example, search all workflow activity scripts to see which ones contain "u_software" somewhere in the script. To do this manually will be very time consuming as well as the potential for blurry eyed oversight mistakes.
Thanks,
Michael
Solved! Go to Solution.
- 20,787 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2013 05:29 AM
To benefit others:
Yes, you can do this search.
1) In the Navigator filter box, type sys_variable_value.list <-- This takes you to the table to search
2) Click on the Filter wizard icon to create a custom filter
--- Table (document) is wf_activity AND
--- Variable.Column Name contains script' OR
------ Variable.Type.Name contains 'script' AND
--- Value contains [whatever you are searching for]
Although, I could not find Variable.Type.Name in the filter wizard. Variable.Type didn't show to have any related fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2021 07:25 AM
This was a great solution. Just wanted I needed. But I did make some enhancements so I thought I would share
- renamed ScriptUtils to WorkflowSearcherScriptUtils to me a more unique name
- Added logic to the rendered results to include
- Added the ability to search a specific workflow or search all published workflows
- direct link to the workflow editor for this result
- added a note if the workflow is currently checked out by someone else
- is this workflow in an open update set for someone else
- the table name the workflow is running on
- What catalog forms will be affected so you can retest (and if its not active its red)
- A code preview showing the line above and below the matched result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2021 12:43 PM
Great tool. I had to modify the query in the WorkflowSearcherScriptUtils at line 30 to get it to work.
Not working:
cExist.addEncodedQuery('document=wf_activity^document=wf_activity^variable.elementLIKEcondition^ORvariable.internal_type.nameLIKEcondition^ORvariable.elementLIKEscript^ORvariable.internal_type.nameLIKEscript^valueLIKE' + searchText + '^document_key=' + wfActivities.getValue('sys_id'));
Working:
cExist.addEncodedQuery('document=wf_activity^valueLIKE' + searchText + '^document_key=' + wfActivities.getValue('sys_id'));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2021 03:47 AM
Below Script search all the workflows to find a keyword
//Use this Fix script to search workflows for a keyowrd
var keyword = 'PROVIDE_YOUR_KEYWORD';
var query = 'valueLIKE'+keyword;
var arr = [];
var tbl = new GlideRecord('sys_variable_value');
tbl.addEncodedQuery(query);
tbl.query();
while(tbl.next()){
var wftbl = new GlideRecord('wf_activity');
wftbl.addQuery('sys_id', tbl.document_key);
wftbl.query();
if(wftbl.next()){
arr.push(wftbl.workflow_version.name);
}
}
for(i=0; i< arr.length; i++){
gs.print(arr[i]);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2021 03:47 AM
Below Script search all the workflows to find a keyword
//Use this Fix script to search workflows for a keyowrd
var keyword = 'PROVIDE_YOUR_KEYWORD';
var query = 'valueLIKE'+keyword;
var arr = [];
var tbl = new GlideRecord('sys_variable_value');
tbl.addEncodedQuery(query);
tbl.query();
while(tbl.next()){
var wftbl = new GlideRecord('wf_activity');
wftbl.addQuery('sys_id', tbl.document_key);
wftbl.query();
if(wftbl.next()){
arr.push(wftbl.workflow_version.name);
}
}
for(i=0; i< arr.length; i++){
gs.print(arr[i]);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2021 12:32 PM
This is exactly what I need it. Thanks a lot!