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