Getting all the roles owned by a specific identity

I have a workflow that sends an email with an specific identity name. The trigger of these workflow is not relevant for my question.

So I want to extend my workflow that it will retrieve all the business role that are owned by that person. And also send all those business role within the email.

My flow now.

Hi @zeross,

You can use an HTTP operation action, calling the search API with body as below :

{
    "indices": [
        "roles"
    ],
    "query": {
        "query": "owner.name:jesvin.joseph"
    },
    "queryResultFilter": {
        "includes": [
            "id",
            "name",
            "type"
        ]
    }
}

This would fetch you the roles owned by the specified user ID.

Then use a send email node, with the templating context as {"name.$":"$.hTTPRequest.body[*].name"}

The email body can then be set up with something like

Below are the requested roles :

${name}

You can try with “Get Access” action item.

If it doesn’t fulfil your criteria, use search API to fetch user roles.

Thanks.

1 Like

@jesvin90 I have it working now. But one question is there a way to get all the roles on a new line?

If I got multiple roles it will end up in a very long string and not good readable anymore.

image

Hi Dennis,
in the email body if it is as follows:

Requested roles are:

    #foreach ( $i in ${name} )
  • $i
  • #end

It may fulfill your requirement of getting each role in newline

Thanks,
tulasi

If teh below case doesnt help you resolve. check this out

Got it working, thanks