Can I use time.now() to create a valid Group Rule?

Hi, I’m trying to group new hires based on their start date by comparing now() to a date attribute. This works if I hard code a date, but it doesn’t if I try to use the now function.

This works:
user.Service_Date gt "2019-06-29T00:00:00.000Z"

This doesn’t:
time.now() lt user.Hire_Date

Is this supported?

If you are using Okta group rule, Time.now() should work. However, your condition seems wrong. Would the current time ever be less than the user.Hire_Date? Also, Okta group rules are evaluated every time the field is updated. So you need to ensure your condition handles that, especially if you are thinking of say, users created within the last month would be in new hire group and will automatically move out of the group after 1 month. I think you will external logic (outside Okta) to handle this scenario.

Reference for Okta group rule: https://help.okta.com/en/prod/Content/Topics/Directory/group-rules.htm

Reference for expression language used in Okta group rule: https://developer.okta.com/docs/reference/okta-expression-language/#time-functions

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.