Workflow - Using Inline Variables in HTTP Request (GET)

I created a workflow to email ‘Description’ of an Entitlement when provisioning is completed i.e when user is added to an AD group. These are the steps; Provisioning Completed > Get Identity > HTTP Request (GET) > Send Email > Success.

If I include the following static query parameters, it works fine but not with inline variables.

Request URL: xxxxxxx.api.identitynow.com/beta/entitlements
Method: GET
Request Content Type: JSON
Request Body: empty
Send Email (Template Context): {“var.$”:“$.hTTPRequest.body[0].description”}

HTTP Request query parameters:
filters: value eq “static value of the entitlement" OR
filters: id eq “Id of the entitlement” OR
filters: name eq “name of the entitlement”

filters: value eq “{{$.trigger.accountRequests[0].attributeRequests.attributeValue}}” doesn’t seem to be working. I’ve tried some other combinations but without any success.

The ‘Provisioning Completed’ trigger payload doesn’t have Id or name of the entitlement and it only contains value of the entitlement in the attributeValue field.

Any help would be appreciated!

Thanks

In this case, you can try to use the Get Access step after the trigger, use Selection method as Search Query and check Entitlements box on action.

In search query use attributeValue from trigger.

name:{{$.trigger.accountRequests[0].attributeRequests.attributeValue}} AND source.name:“Active Directory”

The output of Get Access step can provide you description of entitlement which you can then use in Send Mail notification action.

Thanks @sharvari for your prompt response. Appreciated!

I included the Get Access step after the trigger and removed the HTTP Request (Get) step. It didn’t work as I got an error saying “request failed: 400 Bad Request (type: HTTP Response Returned a Client Error, retryable: false): request failed: 400 - 400 Bad Request

I’ve tested the Get Access action in some other workflows and it only returns Id and name of the entitlement/access profile as well as the type of access. It doesn’t return description of the entitlement/access profile. Please correct me if I am wrong.

The other thing is, I think the inline query parameters in the search query don’t seem to be correct i.e name:{{$.trigger.accountRequests[0].attributeRequests.attributeValue}} AND source.name:“Active Directory”.

Thanks

You are right, it doesn’t include description in the json response.

I haven’t tried this in workflow just typed it up from Search UI.

It’s better to go with HTTP Request to list-entitlements | SailPoint Developer Community API and then filter response to find your entitlement by name.

I’ve tried the HTTP request (GET) to list entitlements but I can’t figure out what inline variables should be used in the filter (query parameters) to get the dynamic value of entitlement from the trigger payload and then get the description by searching entitlement by it’s value (not by Id or name as these are not included in the trigger payload).

I am able to get the description of entitlement by using either a static value or Id or name in the filter. Not sure how to get the dynamic value (attributeValue) of entitlement from trigger payload and then use it in the search/filter to get the description.

filters: value eq “{{$.trigger.accountRequests[0].attributeRequests.attributeValue}}” doesn’t seem to be working.

Hello @nhassan
If the request is getting the attributeName from the trigger, then the following should be the inline variable:
{{$.trigger.accountRequests[0].attributeRequests[0].attributeName}}

Hi @timahm and @sharvari

Sorry for the late reply. The request is getting the attributeValue from the trigger. I’ve got the workflow working perfectly now by using these inline variables.

{{$.trigger.accountRequests[1].attributeRequests[0].attributeValue}}

Another thing, I want to use an operator for a regex to include some part of the description e.g if the attributeValue (description of the entitlement) is [ITSM-1234 \\network file share path], I want to email [\\network file share path] to the user.

I am not sure if the ‘Define Variable’ operator would help me to achieve this and if yes what attributes or data should I use? Any thoughts?

Thanks

Hi @nhassan,

I didn’t get opportunity to use the Define variable. However, I think you can try the following:

  1. define a variable1 to get the index of " \\" as following

image

  1. Then, define another variable2 with substring function by using the variable1 value as “starts from”. I hope the length is known otherwise I don’t see how you can get it.

Regards,

Thanks @timahm for the update.

Your suggested option didn’t work. If I set the Get Index (pattern) value to double backslashes i.e \\ as you have mentioned, it always return “0” value and display the entitlement description from the start i.e ITSM-12345-\\network file share path instead of \\network file share path. The screenshot is attached of both variables. Any idea, why the Get Index operator always returns “0” value regardless you have put anything in the pattern field? Not sure what other combinations we can try to start the indexing from double backslashes.

I can’t use any other operator within the Define Variable operator because the description of entitlement varies i.e some entitlements’ description do have “ITSM-12345” in front of them and some don’t have it.

If I use the ‘Replace’ operator, then I can’t figure out what pattern can be used in the value. The “ITSM-” part is a static value in the description of entitlement but the integer part is a dynamic value e.g 12345 or 45678 etc. Any thoughts, how can we make the pattern value so it covers both the static part as well as the dynamic part (integer)?

Thanks

I am closing this post as the initial issue i.e using inline variables in HTTP GET Request has now been resolved. I’ve created a new post regarding Issue with ‘Get Index’ operator within the Define Variable operator.

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