- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2017 09:33 AM
I have a generic workflow that writes all of the details of the catalog item to comments field on the RITM. (I then suppress the notification that would send that comment.) That workflow is inside of many of my catalog items, but not all of them.
Is there a way for me to get a list of which workflows contain that generic workflow? I tried to see if there was a related list under the Workflow Version that might display a list of all of those workflows, but there doesn't seem to be one. I'd like to make a change to that workflow, but before i do that I'd like to know which catalog items it will impact.
Thanks,
Richelle
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2017 09:58 AM
You can open the table wf_workflow_instance
and search for the subworkflow name with filter activity contains your subworkflow name.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2017 10:09 AM
Hi Richelle,
Please try this code below after replace the child workflow sys id and see if it helps you print out the name of catalog item that needs to be modified.
var relevantParentWorkflows = [];
var wfContext = new GlideRecord("wf_workflow_instance");
wfContext.addQuery("workflow", REPLACE WITH THE CHILD WORKFLOW SYS ID)
wfContext.query();
while(wfContext.next()) {
relevantParentWorkflows.push(wfContext.workflow_version.sys_id + '');
}
var gr = new GlideRecord("sc_cat_item");
gr.addEncodedQuery("type!=bundle^sys_class_name!=sc_cat_item_guide^type!=package^sys_class_name!=sc_cat_item_content^workflowISNOTEMPTY");
gr.addQuery("workflow", relevantParentWorkflows );
gr.query();
while(gr.next()) {
wfArray.push(gr.name + '');
}
gs.print(wfArray.join(","));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2017 10:36 AM
Thank you for your response,
Richelle