Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/21/2023 11:22 AM
Hi Team,
Can you please provide your input for below use case :
Use Case : To import a user from trusted source through REST api and pass a dynamically value in URL. There are two attributes 'Start_Moment' and 'End_Moment', from current timestamp minus 2 hours for attribute 'End_ Moment' and 'Start_Moment' will be current stamp.
For example :
End_Moment = 2023-05-21T02:30:00.000-07:00 ( from this parameter have to minus 2 hours)
Start_Moment = 2023-05-21T00:30:00.000-07:00 ( this parameter will be current timestamp)
Note : I tried with hard coded value it's working and Saviynt version is v2020
URL
https://****************.com/ccx/service/customreport2/travelhrportal1/RaaS?End_Moment=2023-05-17T02:30:00.000-07:00&Start_Moment=2023-05-17T00:30:00.000-07:00&Effective_as_of_Date=${new Date().plus(30).format('yyyy-MM-dd')}&format=json",
I tried for for Start_Moment = ${Calendar.getInstance().getTime().format('yyyy-MM-dd')} but it's seems it didn't work and I am not able to see any error in log also.
PostMan Screen shot:
Thank you
Geeta
05/21/2023 03:06 PM
https://forums.saviynt.com/t5/general-discussions/rest-connector-current-date/m-p/2088#M226
05/30/2023 08:53 PM
@GeSaviynt did it worked ?
05/31/2023 05:28 AM
Hi @musthak_ahamad ,
I am able to pass dynamically current date. I can see in URL date value is converted but yet end to end testing is not completed will update you.
Syntax :
Start_Moment=${Calendar.getInstance().getTime().format(\"yyyy-MM-dd'T'HH:mm:ss:sss\")}&format=json"
Thanks
Geeta
05/31/2023 06:09 AM
But I am facing issue in minus 2 hours from current time stamp and it's not working:
Syntax :
End_Moment=${(Calendar.getInstance().getTime().format(\"yyyy-MM-dd'T'HH:mm:ss:sss\") - (1000*60*60*2))}&Start_Moment=${Calendar.getInstance().getTime().format(\"yyyy-MM-dd'T'HH:mm:ss:sss\")}&format=json",
Note : Start_Moment is working as expected.
Thanks
Geeta
05/31/2023 04:55 PM - edited 05/31/2023 04:55 PM
@GeSaviynt How can i see the output of this api in saviynt .. is there a way? ${Calendar.getInstance().getTime().format(\"yyyy-MM-dd'T'HH:mm:ss:sss\")} curious to see the out so i can get an understanding of minus the values.