Governance group details workflow

I am working on creating a workflow for terminated users. When a user is terminated, we will send an email to their manager that includes all the governance group names of which the manager is a member.

I am using this in the email body to get the governance group names: $.HTTPRequest.body[*].name. However, it returns the names in an array format.

I want each group name to appear on a separate line or as bullet points.

can you send end point which you are using or Json body

you need to use email template context.

context will look something like below. $.getAccounts.accounts is the json path of the object and accounts$ is the variable in the template context.:

{“accounts.$”:“$.getAccounts.accounts”}

your email body should use table and iterate over the array.

<tr>

        <td>$account.sourceName</td>

        <td>$account.disabled</td>

    </tr>

adjust the above to your need.

1 Like

This the api i am using GET - /workgroups?filters=memberships.identityId eq “IdentityId”

Not getting the exact result.

can you post you context configuration and also how your are calling in the email

your send email step will be something like this :

“Send Email”: {
“actionId”: “sp:send-email”,
“attributes”: {
“body”: “{{$.hTTPRequest.body[].name}}\n${workGroupList}\n$workGroupList.getClass()\n#foreach($workGroup in $workGroupList)\n$workGroup\n#end",
“context”: {
“workGroupList.$”: "$.hTTPRequest.body[
].name”
},
“from”: “``no-reply@sailpoint.com``”,
“recipientEmailList”: [
“``email@email.com``”
],
“replyTo”: null,
“subject”: “WorkGroups”
},
“displayName”: “”,
“nextStep”: “End Step - Success”,
“type”: “action”,
“versionNumber”: 2
}

1 Like

this is my workflow Json.



{

    "name": "Termination User ownership",

    "description": "Test -Termination User ownership",

    "modified": "2025-12-02T04:38:06.569977328Z",

    "modifiedBy": {

        "type": "IDENTITY",

        "name": "Abhijit.Patil"

    },

    "definition": {

        "start": "Get Identity 1",

        "steps": {

            "Compare Strings": {

                "actionId": "sp:compare-strings",

                "choiceList": [

                    {

                        "comparator": "StringEquals",

                        "nextStep": "HTTP Request 1",

                        "variableA.$": "$.trigger.newLifecycleState",

                        "variableB": "Terminated"

                    }

                ],

                "defaultStep": "End Step - Success",

                "displayName": "",

                "type": "choice"

            },

            "End Step - Success": {

                "actionId": "sp:operator-success",

                "displayName": "",

                "type": "success"

            },

            "End Step - Success 1": {

                "actionId": "sp:operator-success",

                "displayName": "",

                "type": "success"

            },

            "Get Identity 1": {

                "actionId": "sp:get-identity",

                "attributes": {

                    "id.$": "$.trigger.identity.id"

                },

                "displayName": "",

                "nextStep": "Compare Strings",

                "type": "action",

                "versionNumber": 2

            },

            "HTTP Request 1": {

                "actionId": "sp:http",

                "attributes": {

                    "authenticationType": "OAuth",

                    "jsonRequestBody": null,

                    "method": "get",

                    "oAuthClientId": "ClientId",

                    "oAuthClientSecret": "ClientSecret",

                    "oAuthCredentialLocation": "oAuthInHeader",

                    "oAuthScope": null,

                    "oAuthTokenUrl": "https://{ClientUrl}.identitynow.com/oauth/token",

                    "requestContentType": "json",

                    "requestHeaders": null,

                    "url": "https://{ClientUrl}.api.identitynow.com/beta/workgroups?filters=memberships.identityId%20eq%20%22{{$.getIdentity1.id}}%22",

                    "urlParams": null

                },

                "description": null,

                "displayName": "",

                "nextStep": "Send Email 1",

                "type": "action",

                "versionNumber": 2

            },

            "Send Email 1": {

                "actionId": "sp:send-email",

                "attributes": {

                    "body": "<p>&nbsp;</p>\n<p>{{$.getIdentity1.managerRef.name}}<br><br>{{$.getIdentity1.name}} has terminated. &lt;br&gt;&lt;/br&gt;<br>&lt;Strong&gt;Workgroup Description : &lt;/Strong&gt;&lt;br&gt;<br><br></p>\n<p><!--ScriptorStartFragment--></p>\n<div class=\"scriptor-paragraph\"><!--ScriptorStartFragment-->\n<div class=\"scriptor-paragraph\">{{$.hTTPRequest1.body[*].name}}</div>\n<!--ScriptorEndFragment--></div>\n<div class=\"scriptor-paragraph\"><!--ScriptorEndFragment--></div>\n<div class=\"scriptor-paragraph\"><br><em>{$.hTTPRequest.body[].name}}\\n${workGroupList}\\n$workGroupList.getClass()\\n#foreach($workGroup in $workGroupList)\\n$workGroup\\n#end\"</em></div>",

                    "context": {

                        "accounts.$": "$.getAccounts.accounts",

                        "accountsArr.$": "$.hTTPRequest1.body[*].name",

                        "workGroupList.$": "$.hTTPRequest.body[].name"

                    },

                    "from": null,

                    "recipientEmailList": [

                        "{{ $.getIdentity1.managerRef.email}}"

                    ],

                    "replyTo": null,

                    "subject": "User Terminated {{$.trigger.identity.name}}"

                },

                "description": null,

                "displayName": "",

                "nextStep": "End Step - Success 1",

                "type": "action",

                "versionNumber": 2

            }

        }

    },

    "creator": {

        "type": "IDENTITY",

        "name": "Abhijit.Patil"

    },

    "trigger": {

        "type": "EVENT",

        "attributes": {

            "id": "idn:identity-lifecycle-state-changed"

        }

    }

}

“workGroupList.$”: “$.hTTPRequest.body[*].name”

i tried this as well it giving me this

download your workflow and send a copy here

workGroup.json (4.7 KB)

You can use velocity in the email body.
For example:

In the template context:
“groups.$”:“$.hTTPRequest2.body”

It`s ugly but works!

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.