How to report on what workflows are using specific groups for catalog task and approvals
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2022 06:04 AM
Is it possible to report on a workflow table to show what groups are being used in the workflow catalog task and approval actions? We are looking to consolidate 10 groups into one group and I need to determine where these groups are being used across multiple workflows in order to make the switch. Looking thru each workflow can be tedious and prone to errors. Thanks,
- Labels:
-
Analytics and Reports
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2022 09:45 AM
Hello Chrish,
You find the Workflow Activities in the "wf_activity" table.
In the column "variables", the values of the WF Activity properties are stored but we can't create report on this.
I have alternate solution is that, I have created background script. It will export all data in excel file.
Script -
var output = "Workflow Name,Activity Name,Approval Groups"; //header for csv file
var table = "wf_activity";
var recordId = ""; //using for attachment fill
var gr = new GlideRecord(table);
gr.addEncodedQuery("activity_definition.nameSTARTSWITHApproval - Group");
gr.query();
var count = 0;
while (gr.next()) {
count++;
output += "\n" + gr.workflow_version.getDisplayValue() + "," + gr.name + "," + gr.vars.groups.getDisplayValue();
if (!recordId) {
recordId = gr.sys_id;
}
}
gs.print(recordId);
writeAttachmentFile(output);
function writeAttachmentFile(data) {
var attachment = new Attachment();
var attachmentRec = attachment.write(table, recordId, "WFGroupApproval.csv", "text/csv", data);
}
Note - I run the Query on the WF Activity with the "Approval - Group".
Excel data looks like -
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Akshay Kangankar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2022 11:56 PM
Hello
I hope you are doing well and had great weekend.
Have you tried above solution, please let me know if you need any help.
Thanks & Regards,
Akshay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 09:09 AM
Hi Akshay, I appreciate your response to my question. I ran the query, but this is not getting me what I need. Let me restate what I need in hopes to clarify/simplify. I have multiple groups that I need to know where they are being in used in our workflows. So, let's say one of the groups is called "GMI Support Ag". I need to be able to find what workflows are assigning a task (sctask) to that group or requesting approval from that group. I hope this helps clarify what I am trying to do.
Thanks,
Chris