create scheduled job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2024 03:57 AM
Hi,
Pls advise me to create scheduled job for below scenario:
- Create scheduled job:
- Run daily
- Run job as: System Administrator
- Condition is (table is cmdb_ci_computer and the field operating_system = computer and Last login date field (today – Computer last login date) = 30 or 35
Trigger email notification event XXXXX
- If (today – Computer last login date) = 40
- Create incident
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2024 11:30 AM
You can do this with a Flow. I couldn't create one just like you described, because my cmdb_ci_computer table in my PDI doesn't have the same fields you mentioned. Here are the basic steps to create it, though.
1. Go to Flow Designer and create a new Flow. Set it to run as the System Administrator.
2. Add a trigger to run Daily at whatever time you want.
3. Create a Flow Variable called 40DaysAgo of type Date.
4. The first action should be a "Set Flow Variables" and set your 40DaysAgo variable to gs.daysAgo(40).
5. The next action should be a "Look Up Records" action. Select cmdb_ci_computer for the table and add your conditions.
6. The next action should be a "For Each" and add the Computer Records from the step above.
7. Inside the For Each loop, add an If statement to check if your date is before the 40DaysAgo variable. If so, you can send an Email and/or use a Create Record action to create your Incident.