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

Error with Manager filter in CreateAccountJson

AAbdelghafar
New Contributor
New Contributor

 

Hello everyone,

I'm currently working on editing the createaccountjson for our Active Directory connector. The challenge I'm facing involves filtering and selecting the line manager's Active Directory account for newly created accounts. Specifically, I need to ensure that the line manager's account does not include the word 'admin'.

Whenever I attempt to modify the manager attributes code to enforce this condition, I encounter an error: "Error while creating account in AD - Failed to parse template script." However, reverting the manager attributes code to its previous state resolves the error and allows the account to be created, but it selects a manager account that includes 'admin'.

code snippet: "manager": "${managerAccount.each { acc -> def mngr = acc.comments !(mngr ?. contains('admin') || mngr == null | | mngr.trim() == '')? mngr :null} }",

 

Ps: The DN is stored in the acc.comments

4 REPLIES 4

Raghu
All-Star
All-Star

@AAbdelghafar 

"manager": "${ if (managerAccount == null || acc.comments.contains('admin')){''} else {managerAccount?.accountID} }"


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Thanks for your reply, I tried that code snippet but It shows me ldap error code 21

rushikeshvartak
All-Star
All-Star

"manager": "${managerAccount.find { acc -> acc.comments && !acc.comments.contains('admin') }?.comments}"


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

Thanks for your reply, I tried that code snippet but It's still showing the same error.