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

compare the end date with current date in sav4sav updateuserjson

ankitalande
New Contributor II
New Contributor II

Hii Team,

I have try following syntax for comapre the enddate with current date if end date is pass away to current date then update user cp40 to Ending Today.

 

"httpParams": "{\"username\":\"${user.username}\",\"customproperty40\":\"${if(user.statuskey==0 ) {'Leaver'}else if{(user?.enddate<=(Calendar.getInstance().getTime()))?'true':'false'} else (user.leaveStatus.equals('1')) {'On Leave'}}\"}",

 

I try this syntax but getting error

{"Disable User":{"headers":null,"message":{"errorCode":"0","message":" User Updated Successfully"},"statusCode":200,"description":null,"status":"Failed"}}

 

Please suggest the syntax for this, it will greate help for me.

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

Can you share logs 


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

ankitalande
New Contributor II
New Contributor II

I attach the logs here,log.PNGlog2.PNGlog3.PNG

Share in text file


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

 

I try following syntax for the compare date:

1. ${Date.parse("dd-MM-yyyy", user.customproperty1)>(new Date())?user.customproperty1:(new Date().format("dd-MM-yyyy"));}

2. ${Date.parse("dd-MM-yyyy", user.customproperty1)>(java.util.Calendar.instance.time)?user.customproperty1:(java.util.Calendar.instance.time.format("dd-MM-yyyy"));}

3. {(user?.enddate<=(Calendar.getInstance().getTime()))?'true':'false'}

still same error - {"Disable User":{"headers":null,"message":{"errorCode":"1","message":" Users not found with username ${user.username}"},"statusCode":412,"description":null,"status":"Failed"}}