Is there a way to access a Previous Job from a Recurring Job?


I have a Recurring Job where i want to do some additional code depending of the state of the previous execution.

I know that if I have the JobId, I can get its data with

But I found no way to obtain de JobId from the previous execution…

The way we saw to do it for now is to obtain the JobId of the current execution, with something like
JobStorage.Current.GetConnection().GetRecurringJobs().Where(job => job.Id == RecurringJobId).FirstOrDefault()?.LastJobId
and keep it in memory in a “cache” for the next execution access it :frowning: :frowning: