05/10/2023 04:19 AM
Hi,
We have a dynamic attribute defined at the endpoint level. This attribute is reading value from an SQL query.
We are using this dynamic attribute in createAccountJSON attribute of AD connection object. The mapping is something like this :
"manager":"${svcAccountOwner}"
where, svcAccountOwner is the dynamic attribute.
But, after running the WSRetry job, following error appear in the logs :
ERROR ldap.SaviyntGroovyLdapService - Error while creating account svc_tAcc_np34 in AD - No such property: svcAccountOwner for class: SimpleTemplateScript30770"
Kindly assist here.
Best Regards,
Varun
05/10/2023 05:30 AM
Hello Varunpuri,
Could you please share the sql query and details on how did you set up the dynamic attribute ?
Regards
Harouna SOumare
05/10/2023 05:39 AM
Hello @Hsoumare ,
There are 2 dyanmic attributes here - one is by the name accountNameFromAPI. This is the parent dynamic attribute and is receiving its value from the API call being sent by ServiceNow.
Other dynamic attribute is svcAccountOwner. This is the one whose value should come from an SQL query and whose value depends upon the dynamic attribute named accountNameFromAPI. The SQL query is :
select distinct a.customproperty3 as id from
users u join user_accounts ua on u.userkey = ua.accountkey
join accounts a on a.accountkey = ua.accountkey
join endpoints e on e.endpointkey = a.endpointkey
join (select distinct u.username
from accounts a join accountowners ao on a.accountkey = ao.accountkey
join users u on u.userkey = ao.owneruserkey
where a.name = '${accountNameFromAPI}'
)q on q.username = u.username
WHERE lower(e.endpointname)='activedirectory'
and u.statuskey = 1 and lower(a.status) in ('1','manually provisioned','active')
Best Regards,
Varun
05/15/2023 06:50 AM
Hi,
Kindly assist here please.
Best Regards,
Varun
05/18/2023 05:11 AM
Hi,
Need some assistance on this thread please.
Best Regards,
Varun
05/18/2023 05:16 PM
Based on my understanding - assuming the accountNameFromAPI is an existing account. Using the query we are fetching the customproperty3 value of its Owner's. If this understanding is correct, you can use the below query.
Also, once the task gets created, can you please view the task and see if the value for the dynamic attribute is visible to you under task details tab. If the value is visible, you can directly call the dynamic attribute as "${dynattes}". dynattes is the dynamic attribute name I created.
select a.customproperty3 as ID from accounts a inner join user_accounts ua on ua.accountkey=a.accountkey and ua.userkey in (select ao.owneruserkey from accountowners ao inner join accounts a on a.accountkey=ao.accountkey where name = 'CN=00000005,OU=Users,OU=CONNQA,OU=SaviyntTeams,DC=saviyntlabs,DC=org' and endpointkey='62') and a.endpointkey=62
05/19/2023 02:16 AM - edited 05/19/2023 02:28 AM
Hello @sahil
The parent dynamic attribute is visible both under the task details as well as the request details. Snapshot below. But the dynamic attribute which I am trying to calculate based on the parent attribute value is not visible there. The logs show this error :
Error while creating account in AD - No such property: svcAccountOwner for class: SimpleTemplateScript240
The mapping which I have done in the CreateAccountJSON is : "manager": "${svcAccountOwner}"
And svcAccountOwner is the dynamic attribute which is of type Single Select from SQL and is referring to accountNameFromAPI (which is another dynamic attribute) as its parent attribute.
Kindly assist further.
Best Regards,
Varun
05/19/2023 08:18 AM
Can you create a support ticket for this. You can also add a comment to assign the ticket to me for further troubleshooting.
05/22/2023 02:26 AM
Hello @sahil ,
I have already opened a support ticket for this - https://saviynt.freshdesk.com/support/tickets/1627406
And we are conversing already there. The only difference is that I am trying to explore 2 different solutions for the same problem. In the ticket, we are conversing over a piece of Groovy script/java code whereas on this thread I am trying to resolve the same problem through dynamic attributes.
In an earlier version, I have used the dynamic attribute for calculating the AD attribute in CreateAccountJSON mapping. But I see that the same is not working in this version (23.2). I hope I am not making any mistake.
Best Regards,
Varun
05/23/2023 08:28 AM
Yes, I understand but this issue will require another support ticket if we also need to explore Dynamic attribute solution.
05/24/2023 09:32 PM
@sahil - I have opened another ticket for this thread - #1631027 Unable to read Dynamic Attribute in createAccountJSON of AD connection object
Best Regards,
Varun
05/26/2023 09:00 AM
Thank you. I will have this checked.
05/29/2023 08:21 PM
Share dynamica attribute screenshot
05/29/2023 08:52 PM
Snapshot of parent dynamic attribute : accountNameFromAPI
Snapshot of dependent/child dynamic attribute : svcAccountOwner
05/29/2023 09:49 PM
Try ${customproperty5}
05/29/2023 10:11 PM
@rushikeshvartak - getting this error :
Error while creating account in AD - No such property: customproperty5 for class: SimpleTemplateScript10461
Best Regards,
Varun
06/08/2023 08:48 AM