Get a list of all jobs running in a Clarity PPM system
search cancel

Get a list of all jobs running in a Clarity PPM system

book

Article ID: 144918

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

  • Jobs can be scheduled by different admin accounts in Clarity PPM, and some of them can be invisible from any given admin account.
  • Therefore, how can I extract a list of all the jobs that have executed upto a point in time, irrespective of which admin account it was scheduled from?
  • (And also get useful information such as their execution times, parameters used etc.?)

Resolution

  1. Following is a query that can be run on the Database of a given system, to get such a list. (For On Premise customers)
  2. This can also be modified into an NSQL Query to create a portlet. (For On Premise and SaaS customers)
    • If we are interested in specific jobs, then provide that job's name in the WHERE clause, otherwise comment it out.
SELECT
    jrun.job_id,
    j.name,
    jparam.value,
    ccn.name parameter_name,
    CAST(jrun.start_date AS TIMESTAMP) start_date,
    CAST(jrun.end_date AS TIMESTAMP) end_date,
    round(
        jrun.total_execution_time / (1000 * 60),
        2
    ) "ExecutionTime(Minutes)",
    jrun.status_code,
    sr.full_name username,
    jrun.scheduler_id
FROM
    cmn_sch_job_runs jrun
    JOIN cmn_sch_jobs j ON j.id = jrun.job_id
    JOIN srm_resources sr ON sr.user_id = jrun.user_id
    LEFT JOIN cmn_sch_job_run_params jparam ON jparam.job_run_id = jrun.id
    LEFT JOIN cmn_view_attributes att ON
        jparam.attribute_id = att.attribute_id
    AND
        att.display_order = 0
    LEFT JOIN cmn_captions_nls ccn ON
        ccn.pk_id = att.id
    AND
        ccn.table_name = 'CMN_VIEW_ATTRIBUTES'
    AND
        ccn.language_code = 'en'
WHERE
  lower(j.name) LIKE '%<provide job name in lower case>%'
ORDER BY
    jrun.start_date DESC,
    jrun.job_id,
    ccn.name ASC;
 
Some examples of interpreting the resultant dataset for the above query.

1. Since the Load Data Warehouse job has only one parameter, there will be a single row for each execution of this job


2. There can be jobs with more than one parameter in them. For such jobs, the number of rows per execution will be equal to the number of parameters in the job.