and more in a single search tool across platforms. Read the announcement here. |
11/07/2022 09:51 PM
Hi Team,
We have a use case where on user termination we want to set the user's AD account's accountExpires to currentdate + 90 days.
Currently, in DISABLEACCOUNTJSON we have the following.
"accountExpires": "${{Long.toString(10000*(Calendar.getInstance().getTime() + 7776000000 + 11644473600000))}}"
But this is throwing the error as shown below:
{"log":"groovy.lang.MissingMethodException: No signature of method: java.util.Date.plus() is applicable for argument types: (java.lang.Long) values: [7776000000]\n","stream":"stdout","time":"2022-11-08T05:30:58.133544137Z"}
Please help us what will resolve this issue.
Thanks,
Rahul Mulik
11/08/2022 07:28 PM
Are you setting the termination date from HR in any of the user attribute ?
If Yes,then you could so something a simple as:
"accountExpires": "${(10000*(user.enddate.getTime() + 7776000000+ 11644473600000))}"
11/08/2022 08:31 PM
Hi @avinashchhetri ,
What if we want to set current date + 90 days?
Is it not possible?
Thanks,
Rahul Mulik
12/19/2022 09:40 PM
Hi Experts,
Can we add 90 days to the current date and pass?
Thanks,
Rahul Mulik
12/19/2022 09:44 PM
"accountExpires": "${(10000*(Calendar.getInstance().getTime() + 7776000000+ 11644473600000))}"
12/20/2022 11:39 PM
Hi Rushikesh,
I tried the below JSON in Disable Account and it gives me the below error in logs.
JSON:
{
"userAccountControl": "514",
"extensionAttribute1": "",
"accountExpires": "${(10000*(Calendar.getInstance().getTime() + 7776000000+ 11644473600000))}",
"password": "TestPassword"
}
Error:
12/21/2022 09:01 AM
try new date()
02/23/2023 12:22 PM
Was this ever resolved? I tried the same thing but just went to set current date without + 90 days by using "${(Calendar.getInstance().getTime() + 11644473600000) * 10000 }" and tried using new date as well, but I get the same error as you with both. What is the correct solution to set current date on accountExpires attribute?
04/04/2023 02:23 AM
As a work around, instead of using Calendar object, Can you try using task object's startdate or updatedate
${(task.updatedate().getTime() + 11644473600000) * 10000 }
Thanks,
Nitish