and more in a single search tool across platforms. Read the announcement here. |
10/30/2023 07:22 PM
Hi all,
I'm creating a create account json for AD and I put ${user.displayname} in "displayname."
So I want to convert the character of user.displayname to another character by regular expression.
===createaccountjson===
{
"userPrincipalName": "${user.username+'@<domainname>'}",
"displayname": "${user.displayname.replace(/[\u3041-\u3096]/g,function(match) {return String.fromCharCode(match.charCodeAt(0)+0x60);})}",
"objectClass": [
"top",
"person",
"organizationalPerson",
"user"
],
"pwdLastSet": "0",
"sAMAccountName": "${task.accountName}",
"userAccountControl": "544",
"description": "Account provisioned by Saviynt"
}
======================
However, when I execute Job, I get the following error:
===error===
Checking DN for CN=xxx,OU=Users,OU=Lab,DC=xxx,DC=xxx.Not FOund DN for CN=xxx xxx,OU=Users,OU=Lab,DC=xxx,DC=xxx. Error while creating account in AD - nullChecking DN for CN=xxx,OU=Users,OU=Lab,DC=macsaviynt,DC=local.Not FOund DN for CN=xxx xxx,OU=Users,OU=Lab,DC=xxx,DC=xxx. Error while creating account in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript16840.groovy: 3: unexpected token: g @ line 3, column 68. name.replace(/[\u3041-\u3096]/g,function ^ 1 error Checking DN for CN=xxx xxx,OU=Users,OU=Lab,DC=xxx,DC=xxx. Not FOund DN for CN=xxx xxx,OU=Users,OU=Lab,DC=xxx,DC=xxx. Error while creating account in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript16858.groovy: 3: unexpected token: g @ line 3, column 68. name.replace(/[\u3041-\u3096]/g,function ^ 1 error
==========
Can you give me some advice?
10/30/2023 08:34 PM
Sample Example :
${user.displayname.replaceAll("\\s+\\", "-")}
10/30/2023 08:43 PM
@JPMac This is somthing i did in past for comments attribute :
${task.requestKey==null?'':task.requestKey?.comments?.replaceAll('<.*?>','').replaceAll('\\n','').replaceAll('\\r','').replaceAll('[^ -~À-ÿ]+','').replaceAll(new String('XFw='.decodeBase64()),new String('XFxcXA=='.decodeBase64()))}
Can you try checking something similar can help you.
10/30/2023 09:34 PM
Thanks for your comment.
Based on your comment, I changed the writing style as follows, but it's not working.
${user.displayname.replaceAll(/[\u3041-\u3096]/, match => String.fromCharCode(match.codePointAt(0) + 0x60))}
Can you give me any advices?
10/30/2023 09:38 PM
what is error
10/30/2023 09:54 PM
in Log viewer
====
084 [quartzScheduler_Worker-3] ERROR ldap.SaviyntGroovyLdapService - Error while creating account XXX in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed:\n"
===
in Task comment
===
Checking DN for CN=XXX,OU=Users,OU=YYY,DC=ZZZ,DC=ZZZ.Not FOund DN for CN=XXX,OU=Users,OU=YYY,DC=ZZZ,DC=ZZZ. Error while creating account in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript16893.groovy: 3: unexpected token: > @ line 3, column 116. All(/[\u3041-\u3096]/, match => String.f ^ 1 error Checking DN for CN=XXX,OU=Users,OU=YYY,DC=ZZZ,DC=ZZZ.Not FOund DN for CN=XXX,OU=Users,OU=YYY,DC=ZZZ,DC=ZZZ. Error while creating account in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript16894.groovy: 3: unexpected token: > @ line 3, column 80. All(/[\u3041-\u3096]/, match => String.f ^ 1 error Checking DN for CN=XXX,OU=Users,OU=YYY,DC=ZZZ,DC=ZZZ.Not FOund DN for CN=XXX,OU=Users,OU=YYY,DC=ZZZ,DC=ZZZ. Error while creating account in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript16895.groovy: 3: unexpected token: > @ line 3, column 80. All(/[\u3041-\u3096]/, match => String.f ^ 1 error
===