Add multiple entitlements to delimited account through workflow

Hello Everyone,

We have created two workflows,
1st Workflow - Through External trigger we are requesting either single or multiple entitlements and creating the serviceNow ticket. We are storing that ticket Number ,application name which we requested, entitlement which we requested, static ticket status as “Open” and some other details like firstname,lastname… in one dummy delimited account(cais_temp_account_creation delimited) each ticket number creates one account

User can have more than 1 account.

2nd Workflow - we have trigger as schedule trigger which will loop the delimited accounts(cais_temp_account_creation delimited) of particular user and get the ticket Number from that account and check that ticket in ServiceNow whether it is open or closed if it is closed then we need to created the account using cais_temp_account_creation delimited attributes (in that account we have requested application name(this is original delimited application), requested entitlement, other details like firstname…). We used V3 Create API to create the account of original delimited application (name is storing in attribute of dummy application). It is working fine for Single entitlement but if that Application Name which we requested is multi entitlement then old entitlement is getting replaced with new entitlement .

Could Someone please help how to add the entitlement if application is Multi entitlement.

Hi @karishma_shaik2 , You can send the multiple entitlements in an array. Before that check if the attribute is marked as multivalued. If yes then:

  1. Using HTTP operation and Access Request API’s you can send both the entitlement JSON body’s as an array
  2. Using Manage Access > Add Access > JSON of entitlements as below
[
  {
    "id": "technicalID",
    "name": "accessItemName",
    "type": "accessItemType"
  },
  {
    "id": "technicalID",
    "name": "accessItemName",
    "type": "accessItemType"
  }
]

Hi @karishma_shaik2

You cannot create multiple accounts with the same account ID.

The behavior of the V3 API for creating accounts is as follows:
When you send a request to create an account for a source, the API checks if another account with the same account ID already exists. If an account with the specified ID exists, the API will update the existing account instead of creating a new one. For example, it may replace or modify the entitlements associated with the account.

If the same user requires multiple entitlements on your designated source, you should first check if the account already exists. If it does, update the account to include both the old and new entitlements. Use the PUT Account API for this purpose.

Unfortunately, when using the PUT method, you must send all attributes of the account during the update process. This is because the PATCH method only allows updates to specific fields like identityId and manuallyCorrelated and cannot modify other account attributes. For more details, refer to the Update Account API documentation.

1 Like

Hello @baoussounda ,

We tried with PUT Account API in Postman. The Jsonpath we used is

{
    "attributes":
{
    "Id":"xxx",
    "Name":"xxx",
    "FirstName":"xxx",
    "LastName":"xxx",
    "Location":"xxx",
    "Manager":"xxx",
    "Email":"xxx",
    **"User Role":"Entitlement1,Entitlement2",**
   "Status":"xxxx"
   }
}

Two entitlements got appended.
But if we use this in workflow as

{
    "attributes":
{
    "Id":"xxx",
    "Name":"xxx",
    "FirstName":"xxx",
    "LastName":"xxx",
    "Location":"xxx",
    "Manager":"xxx",
    "Email":"xxx",
    **"User Role":"{{$.hTTPRequest.body.attributes.User Role}},Entitlement2",**
   "Status":"xxxx"
   }
}

In hTTPRequest.body.attributes.User Role we already have Entitlement1. If we pass this entitlement2 then request is getting failed.

Hi @karishma_shaik2,

Please try this :

{
    "attributes":
{
    "Id":"xxx",
    "Name":"xxx",
    "FirstName":"xxx",
    "LastName":"xxx",
    "Location":"xxx",
    "Manager":"xxx",
    "Email":"xxx",
    "User Role":[{{$.hTTPRequest.body.attributes['User Role']}},'Entitlement2'],
   "Status":"xxxx"
   }
}
1 Like

Hello @baoussounda

I used below format for that attribute

"User Role":"{{$.hTTPRequest.body.attributes.['User Role']}},Super"

Thanks alot

Hello Everyone,

Could someone help who to remove the entitlement without using manage access in workflow for delimited application.

Hi @karishma_shaik2

Please have a new topic posted for this. It will be more helpful to understand the issue clearly and for better visibility of larger audience.

@karishma_shaik2 if your source is delimited file source, you can use the same update account api.

For example if your attributes contain [“Entitlement 1”,“Entitlement 2”,“Entitlement 3”]. To remove for example “Entitlement 3” you can use :

{
  "LastName":"xxx",
    "Location":"xxx",
    "Manager":"xxx",
    "Email":"xxx",
    "User Role":['Entitilement1','Entitlement2'],
   "Status":"xxxx"
   }

Hello @baoussounda,

If now user role = {{$.hTTPRequest.body.attributes.[‘User Role’]}} contains Adjuster, Admin - then how can i remove just one entitlement from that attribute ?

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