• Which versions have you tested this logic on? I'm getting below error.

    Msg 8114, Level 16, State 1, Procedure xp_sqlagent_enum_jobs, Line 1

    Error converting data type nvarchar to int.