and more in a single search tool across platforms. Read the announcement here. |
08/30/2022 06:54 AM
Hi,
So I have been having an issue figuring out how to do calculations within the connection json. I want to be able to look at the users start date and subtract 3 days and see if the current date is greater than or equal to that date.
Essentially we have new hires start on Mondays and we want to move them from our New Hire OU to our Employee OU so they get all their privileges the friday before they start. I already have the analytic and job set up to create the update task for these specific users but I just can't figure out the UPDATEACCOUNTJSON part. Any help would be appreciated.
Thanks
Solved! Go to Solution.
09/01/2022 01:52 AM
Hi @tcorcoran
Please look at the below forum thread if it gives you pointers on how to do it :
https://forums.saviynt.com/t5/identity-governance/sms-sending-is-not-working-in-to-field-of-email-te...
09/01/2022 12:57 PM
How do you subtract 3 days from the startdate
(Calendar.getInstance().getTime() >= user.startdate))
This is how I currently have it set up but this is not working.
Thank you
09/01/2022 08:59 PM
3 Days minus --> new Date(Calendar.getInstance().getTimeInMillis()-(3*86400000))
09/02/2022 06:12 AM
Our dev environment is currently on an update that does not allow objects such as "new Date" or "new String" I tried what you recommended but it didn't end up working. Here is the line I tried below:
I also tried:
09/02/2022 11:00 AM
Yes as part of new version new keyword is not allowed.
Try below
"moveUsertoOU" : "${if (user.startdate != null && (Calendar.getInstance().getTimeInMillis()-(3*86400000))) >= user.startdate.getTime()) 'OU=Employees,DC=vfcu,DC=org'}"
09/02/2022 11:59 AM
When I tried that it came back with this:
Error while Update operation for account-eevans in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript36.groovy: 5: unexpected token: >= @ line 5, column 114. TimeInMillis()+(3*86400000))) >= user.st ^ 1 error
I also tried converting the milliseconds into an actual number instead of doing the multiplication and that came back with the same error.
09/02/2022 12:06 PM - edited 09/02/2022 12:08 PM
"moveUsertoOU": {"{${if(user?.startdate != null && (Calendar.getInstance().getTimeInMillis()-(3*86400000)) >= user.startdate.getTime()){\"OU=Employees,DC=vfcu,DC=org\"}}"
09/02/2022 12:59 PM
Yup that ended up working thank you.