How to report on what workflows are using specific groups for catalog task and approvals

chrish5
Giga Guru

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,

3 REPLIES 3

Community Alums
Not applicable

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".

find_real_file.png
Excel data looks like -

find_real_file.png

 

If my answer helped you in any way, please then mark it as helpful.

Kind regards,

Akshay Kangankar




Community Alums
Not applicable

Hello @chrish ,

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

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