Scheduled Data Import Failed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 06:04 AM
Hi
I have scheduled script which deactivates user which has not been synched with LDAP over a period of time. However I have 2 Scheduled Data Imports. Main and parent. Scheduled script is checking if there is at least one record synchronized(as per attached part of the script). However I need to check if both data imports ran successfully. Now it checks in general and if only one runs scheduled script with proceed with deactivation which is not desired.
var LastSync= new GlideRecord("sys_user");
LastSync.addEncodedQuery("u_last_syncRELATIVEGT@hour@ago@24^active=true");
LastSync.setLimit(1);
My question is how to achieve that. I see that there is an option Execute Post Import Script in Scheduled Data Import. I can export even log there and search it in scheduled script if such a log was generated but I am not sure if scheduled data import fails it does not execute post import script. Is it good approach or is there a different way to check this?
Regards
Piotr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 06:15 AM
I would make it that both imports update the u_last_sync date, so if one fails, you still have the other. But since it can also happen that both fail, for whatever reason, maybe put some notifications on the integration to validate if it ran at all.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 06:22 AM
Hi
It is working like that now, but I must stop deactivateing users if at least one fails( in this case Child one as when parent fails nothing will be updated so not an issue). Now when main one updates users( for one part of the users) you will have at least 1 updated record. Second one fails and those users( second part of the users) are not updated and script disables them and it is incorrect.