Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

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 you find this response useful, kindly consider selecting 'Accept As Solution' and clicking on the 'Kudos' button.

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