Skip to content

[TASK] Implement system jobs list and delete endpoints #35207

@hassandotcms

Description

@hassandotcms

Description

Implement GET /v1/maintenance/_systemJobs and DELETE /v1/maintenance/_systemJobs/{group}/{name} in MaintenanceResource.java. The list endpoint returns all Quartz scheduler jobs with trigger details. The delete endpoint removes a specific job by group and name.

Acceptance Criteria

GET /v1/maintenance/_systemJobs

  • API caller must receive a list of all Quartz jobs across all job groups
  • Each job must include: name, className (simple name), group, durable, stateful, volatile
  • Each job must include: running (boolean from QuartzUtils.isJobRunning()), nextFireTime (epoch millis), nextFireTimeFormatted (human-readable string)
  • Each job must include misfireInstruction: "DO_NOTHING", "FIRE_ONCE_NOW", or "UNKNOWN" (for CronTrigger instances)
  • Jobs that fail to load (e.g., ClassNotFoundException after upgrade) must still appear in the list with an error field containing the exception message — these are the jobs users need to delete
  • Jobs with no trigger must be excluded from the list
  • Must require CMS Administrator role and Maintenance portlet access

DELETE /v1/maintenance/_systemJobs/{group}/{name}

  • API caller must be able to delete a Quartz job by its group and name
  • Endpoint must call QuartzUtils.removeJob(name, group)
  • API caller must receive confirmation with the deleted job's name and group
  • Must require CMS Administrator role and Maintenance portlet access

Priority

None

Additional Context

  • Job groups come from QuartzUtils.getScheduler().getJobGroupNames()
  • Job names per group from getScheduler().getJobNames(group)
  • Job details from getScheduler().getJobDetail(name, group) — may throw if job class no longer exists
  • Triggers from getScheduler().getTriggersOfJob(name, group) — first trigger is used for next fire time and misfire info
  • The JSP wraps each job in try/catch — jobs that throw exceptions get a delete button. The REST endpoint must replicate this by returning errored jobs with an error field
  • Struts legacy: ViewCMSMaintenanceAction._deleteScheduler() lines 282–289
  • JSP legacy: system_jobs.jsp lines 39–108

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions