Uploaded image for project: 'JS - JobScheduler'
  1. JS - JobScheduler
  2. JS-1890

Notify via summary report on successful/failed job executions

    XMLWordPrintable

    Details

      Description

      Current Situation

      • If jobs are executed then this information is visible from the "History" view.
      • Users have to actively check the history of task executions.

      Desired Behavior

      • JobUsers would like to receive a summary report of the task execution history:
        • a job should be available that can be scheduled for repeated execution during the day.
        • the information included with the job output corresponds to what is visible from the "History" view in JOC Cockpit..

      Implementation

      • The functionality is available with the Get-JobSchedulerTaskHistory and Get-JobSchedulerOrderHistory cmdlets:
      • The job implementation looks like this:
        • <job title="Report Task History" process_class="agent_windows">
            <script language="powershell"><![CDATA[
          Import-Module $env:SCHEDULER_DATA/config/powershell/Modules/JobScheduler;
          
          Connect-JS -Url $JOCCockpitUrl -Credential $JOCCockpitCredential | Out-Null;
          
          # Dates in local timezone, output includes local date format
          Get-JSTaskHistory -Timezone (Get-Timezone ) `
                          |  Select-Object -Property @{name="JobScheduler ID"; expression={$_.jobschedulerId}}, `
                                                     @{name="Task ID"; expression={$_.taskId}}, `
                                                     @{name="Job"; expression={$_.job}}, `
                                                     @{name="Status"; expression={$_.state._text}}, `
                                                     @{name="Start Time"; expression={ Get-Date $_.startTime }}, `
                                                     @{name="End Time"; expression={ Get-Date $_.endTime }}, `
                                                     @{name="Duration (sec.)"; expression={ (New-Timespan -Start "$($_.startTime)" -End "$($_.endTime)").Seconds }}, `
                                                     @{name="Criticality"; expression={$_.criticality}}, `
                                                     @{name="Exit Code"; expression={$_.exitCode}} `
          ]]></script>
            <run_time/>
          </job>
      • For notification

      Maintainer Notes

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ap Andreas Püschel
                Reporter:
                ap Andreas Püschel
                Approver:
                Kanika Agrawal
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: