Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Pass the existing roles while adding new one

Neeharika008
New Contributor
New Contributor

Hi Experts,

We have to pass the existing access with the new access . So we are calling the acess assigned in the 1st call . Please find the response is the below way :

"roles": [
{
"id": "66",
"name": "InfosysUser"
},{
"id": "76",
"name": "InfosysUser1"
}
]

And we have to pass these role ids from the 1st response as a body to the second call and the format of passing is below:

"roleIds": [
133,
170
]

 

Please let us know how we can do this.

 

Regards,

Neeharika

2 REPLIES 2

adriencosson
Valued Contributor
Valued Contributor

Hi @Neeharika008 ,

Let's say the your entitlementype is "Role", you can use the below sample code to iterate through roles list :

${List ids=new ArrayList();for (Map map : response.Role1.message.roles){ids.add(map.id)}

This way you can store the ids into a list to be used in the "roles" attributes afterwards.

Regards,
Adrien COSSON

rushikeshvartak
All-Star
All-Star

Can you share draft json prepared so far


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.