# Workflow to trigger for user role removal

**URL:** <https://developer.sailpoint.com/discuss/t/workflow-to-trigger-for-user-role-removal/81158>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows, identity-security-cloud, identityiq, provisioning\
**Created:** [September 13, 2024, 1:25pm UTC](https://developer.sailpoint.com/discuss/t/workflow-to-trigger-for-user-role-removal/81158 "2024-09-13T13:25:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![skotian](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@skotian](https://developer.sailpoint.com/discuss/u/skotian)\
**Post date:** [September 13, 2024, 1:25pm UTC](https://developer.sailpoint.com/discuss/t/workflow-to-trigger-for-user-role-removal/81158/1 "2024-09-13T13:25:58Z")

</div>

Hello,

I have a project requirement where I need to create a Workflow for user whose role starting with ‘FSM’ for particular Target source got removed and user has no roles exist that start with ‘FSM’ then email should be triggered to Particular group of users.

I have below created below workflow, but its not working.

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/e/c/ec5dbf54a9e7864ca333cba3ac1b45f3b275462b.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/d/b/db127454808e4f92be979f1744d2946346dcf418.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/6/6/66ec1df8ab639940d6102dcedb6450f3adb3dd1d.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/7/6/761d1bca86beb10586bdca5f3ef7e6f8e7490fda.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/a/3/a3b35693ef4066575cba08d7dc4b7d88584e043f.png)

---

<div class="post-metadata">

**Author:** ![shaileeM](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/shaileem/32/15314_2.png) [@shaileeM](https://developer.sailpoint.com/discuss/u/shaileeM)\
**Post date:** [September 13, 2024, 1:28pm UTC](https://developer.sailpoint.com/discuss/t/workflow-to-trigger-for-user-role-removal/81158/2 "2024-09-13T13:28:43Z")

</div>

Hi @skotian ,

When you mentioned its not working, do you mean workflow is not getting triggered or it gets triggered but it doesn’t send out email?

---

<div class="post-metadata">

**Author:** ![skotian](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@skotian](https://developer.sailpoint.com/discuss/u/skotian)\
**Post date:** [September 13, 2024, 1:40pm UTC](https://developer.sailpoint.com/discuss/t/workflow-to-trigger-for-user-role-removal/81158/3 "2024-09-13T13:40:38Z")

</div>

It is getting trigged but at attribute value stage condition is not satisfied

---

<div class="post-metadata">

**Author:** ![MeKhalbi](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@MeKhalbi](https://developer.sailpoint.com/discuss/u/MeKhalbi)\
**Post date:** [September 13, 2024, 2:13pm UTC](https://developer.sailpoint.com/discuss/t/workflow-to-trigger-for-user-role-removal/81158/4 "2024-09-13T14:13:46Z")

</div>

Hi @skotian ,

First, I guess by using the filter on the provisioning completed, you make sure that this workflow is only triggered when there is a remove action on that particular source so there is no need to have a double check.

Regarding the check attribute value, I am assuming you are trying to check if the group being removed starts with “FSM”. Can you please try this filter instead : " $.trigger.accountRequests[1].attributeRequests[?(@.attributeName == “_nameOfYourattribute_”)].attributeValue "

I would also suggest that you use a webhook to get the trigger JSON and then use a tool like [JSON Path Finder](https://jsonpathfinder.com/) to help you with the JSON path you have to use. To setup the webhook workflow please check this post: [Testing Workflows in IdentityNow Using Webhook.site - Content / Community Blog - SailPoint Developer Community](https://developer.sailpoint.com/discuss/t/testing-workflows-in-identitynow-using-webhook-site/12868)

---

<div class="post-metadata">

**Author:** ![skotian](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@skotian](https://developer.sailpoint.com/discuss/u/skotian)\
**Post date:** [September 13, 2024, 3:37pm UTC](https://developer.sailpoint.com/discuss/t/workflow-to-trigger-for-user-role-removal/81158/5 "2024-09-13T15:37:38Z")

</div>

Thank you, still same attribute issue.

---

<div class="post-metadata">

**Author:** ![shaileeM](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/shaileem/32/15314_2.png) [@shaileeM](https://developer.sailpoint.com/discuss/u/shaileeM)\
**Post date:** [September 13, 2024, 4:11pm UTC](https://developer.sailpoint.com/discuss/t/workflow-to-trigger-for-user-role-removal/81158/6 "2024-09-13T16:11:27Z")

</div>

Hi @skotian ,

Referring to the [Triggers - SailPoint Identity Services](https://documentation.sailpoint.com/saas/help/workflows/workflow-triggers.html#provisioning-completed) JSON sample, you can try below for the `Check Attribute Value` Step:

`$.trigger.accountRequests[0].attributeRequests[?(@.attributeName == "<nameOfYourattribute>")].attributeValue`

Also, agree with @MeKhalbi , you do not need `Provisioning Operator to Remove` Step.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [November 12, 2024, 4:11pm UTC](https://developer.sailpoint.com/discuss/t/workflow-to-trigger-for-user-role-removal/81158/7 "2024-11-12T16:11:34Z")

</div>

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