Problem

  • The subject for mail should be customized for jobs ended with error

Solution

  • see "How to configure an e-mail service" to change the JobScheduler configuration if required.
  • Change the sytelsheet for JobScheduler e-mail service to define how to handle job errors

from (around line 150 in the xsl stylesheet) modify

    <xsl:template match="/scheduler_event [@severity='error' and @event='task_ended']" mode="custom-subject">
               
        <subject>
            <xsl:if test="$lang='de'">[<xsl:value-of select="/scheduler_event/@severity"/>] Task <xsl:value-of select="$job/@job"/> 
                  <xsl:apply-templates select="$task/order"/> mit Fehler beendet</xsl:if>
            <xsl:if test="$lang='en'">[<xsl:value-of select="/scheduler_event/@severity"/>] Task <xsl:value-of select="$job/@job"/> 
                  <xsl:apply-templates select="$task/order"/>  terminated with errors</xsl:if>
        </subject>
    </xsl:template>

to

    <xsl:template match="/scheduler_event [@severity='error' and @event='task_ended']" mode="custom-subject">
               
        <subject>
            <xsl:choose>
              <xsl:when test="$lang='de'">
                [<xsl:value-of select="/scheduler_event/@severity"/>] Task <xsl:value-of select="$job/@job"/> 
                       <xsl:apply-templates select="$task/order"/> mit Fehler beendet
              </xsl:when>
              <xsl:otherwise>
                [<xsl:value-of select="/scheduler_event/@severity"/>] Task <xsl:value-of select="$job/@job"/> 
                       <xsl:apply-templates select="$task/order"/>  terminated with errors
              </xsl:otherwise>
            </xsl:choose>
        </subject>
    </xsl:template>

 

Due to an JobScheduler imprecision the $lang parameter is not set in any case. Therefore the shipped solution does not work sometimes and an internal default is used.