Disocvery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Everyone,
I have a requirement to add the max_run (Max run time ) of discovery schedules to 2 hours for which i have written an scheduled job and its not working...can someone please guide?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I think you might be overcomplicating this a bit. Each Discovery Schedule already has an out-of-the-box field for Max run time, and you can just set it directly on the schedule record instead of running a scheduled job.
The field you’re trying to update, “max_run,” is actually a glide_duration type, not a plain integer. That’s probably why your script isn’t working, the query won’t match because you’re comparing a duration object to an integer value.
If your goal is to make sure all discovery schedules have a consistent two-hour limit, you can do it much more easily. Either update them in the list view all at once, or create a simple business rule that enforces 7200 seconds on insert or update. That way you’re using the built-in functionality instead of scripting around it.
Here’s what that field looks like in the schedule form, you can see “Max run time” right there, and in the dictionary it shows the type as glide_duration.
I hope this helps.
