Skip Headers
Oracle® Enterprise Manager Installation and Configuration Guide for CA Service Desk Connector
Release 1.0.5.1.0

E16519-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

5 Using Default Templates

This chapter provides details on the default ticket templates shipped along with the CA Service Desk Connector. The ticket templates specify the mappings between Enterprise Manager alert attributes and Service Desk ticket attributes.

Template Process

All out-of-box templates cause the following actions to occur when you create a ticket for an alert:

The out-of-box templates are as follows:

Reading and Mapping Ticket Templates

Table 5-1 illustrates the creation of a ticket using the default templates. This illustration will help you to read a ticket template. In the tables, * denotes a literal string and ** indicates whether the attribute applies.

Ticket creation mappings are the same for CASD_Default_Incident_AutoClose.xsl and CASD_Default_Incident.xsl.

Table 5-1 shows Service Desk ticket attributes and corresponding Enterprise Manager alert values for ticket creation mappings.

Table 5-1 Ticket Creation Mappings (for all templates)

Service Desk Ticket Attributes Enterprise Manager Alert Attributes Value

Summary

Message

N/A

Description

For metric alerts:

EMUser - Notification rule owner when the ticket is created through auto-ticketing, and is the Enterprise Manager log-in user when the ticket is created through manual-ticketing.

TargetType

TargetName

MetricColumn - Name of the metric, such as CPU Utilization (%).

MetricName - Category of the metric. For the CPU Utilization (%) metric, this would be 'Load.'

TargetProperties** - name:value pairs of defined target properties. For example:

Line of business:

Finance

Owner:

Finance-DB Team

KeyColumn ** - For metrics that monitor a set of objects, KeyColumn indicates the type of object monitored. For example, for the Tablespace Space Used (%) metric that monitors tablespace objects, the KeyColumn is 'Tablespace Name.'

KeyValues ** - For metrics that monitor a set of objects, the KeyValues indicate the specific object that triggered the severity. For example, for the Tablespace Space Used (%) metric that monitors tablespace objects, KeyValues is 'USERS' if the USERS tablespace triggered at warning or critical severity.

Severity

CollectionTime

TargetHost

NotificationRuleName

URL - URL to the metric details page in the context of the alert.

Values from alert context

Description (continued)

For job status events:

EMUser - Notification rule owner

JobName

JobType

JobOwner

JobStatus

JobTarget - Includes TargetName and TargetType, such as the host name of the targetType "Host."

CollectionTime

NotificationRuleName

URL - URL of the Job Event page. Values from the alert context.

Values from alert context

Priority

Severity - Applies to metric alerts

JobStatus - Applies to job status events

For metric alerts:

  • If severity is Critical, Unreachable Start or Agent Unreachable Start set Priority to Medium (3).

  • Otherwise, set Impact to Low (5).

For job status events:

  • If the JobStatus is Initialization Error, Failed, or Failed and Retried set Priority to High(1).

  • If the JobStatus is Skipped set Priority to Medium-High(2).

  • If the JobStatus is Scheduled, Running, or Queued set Priority to Low(1).

  • If the JobStatus is Success set Priority to None.

  • Otherwise, set Priority to Medium-Low(2).

Reported By

N/A

Administrator

Activity Log

For metric alerts:

Severity

Message

For job status events:

JobStatus

Message

For metric alerts:

Ticket created by Oracle Enterprise Manager Connector for CA Service Desk based on an alert with <Severity> severity. Message: <Message>

For job status events:

Ticket created by Oracle Enterprise Manager Connector for CA Service Desk based on a job with a status of <JobStatus>. Message: <Message>

Status

N/A

*Open (OP)


Table 5-2 shows Service Desk ticket attributes and corresponding Enterprise Manager alert attributes and values for CASD_Default_Incident_AutoClose.xsl mappings.

Table 5-2 Ticket Updates (CASD_Default_Incident_AutoClose.xsl Mappings)

Service Desk Ticket Attributes Enterprise Manager Alert Attributes Value

Identifier

TicketID - Extracts only the internal identifier from the ticket id

N/A

Summary

Message

N/A

Priority

Severity - Applies to metric alerts

JobStatus - Applies to job status events

For metric alerts:

  • If severity is Critical, Unreachable Start or Agent Unreachable Start set Priority to Medium (3).

  • Otherwise, set Impact to Low (5).

For job status events:

  • If the JobStatus is Initialization Error, Failed, or Failed and Retried set Priority to High(1).

  • If the JobStatus is Skipped set Priority to Medium-High(2).

  • If the JobStatus is Scheduled, Running, or Queued set Priority to Low(1).

  • If the JobStatus is Success set Priority to None.

  • Otherwise, set Priority to Medium-Low(2).

Status

For metric alerts:

Grace Period

Severity

For job status events:

Grace Period

Job Status Code

For metric alerts:

If Grace Period is set to "Yes" set Status to Open (OP).

If Severity is set to Clear, Unreachable Clear, Agent Unreachable Clear, Blackout End or Metric Error End set Status to Close (CL).

Otherwise do not set Status.

For job status events:

If Grace Period is set to "Yes" set Status to Open (OP).

If Job Status Code is set to Success (5) set Status to Closed (CL).

Otherwise do not set Status

Activity Log

For metric alerts:

Grace Period

Severity

Message

For job status events:

Grace Period

JobStatus

Message

For metric alerts:

If Grace Period is set to "Yes" set Activity Log to "Ticket reopened because the associated alert re-triggered at <Severity> severity within the grace period. Message: <Message>"

If Severity is set to Clear, Unreachable Clear, Agent Unreachable Clear, Blackout End or Metric Error End set Activity Log to "Ticket closed by Oracle Enterprise Manager because the associated alert has been cleared."

Otherwise set Activity Log to "Ticket updated due to change in severity of the associated alert. Severity: <Severity> Message: <Message>"

For job status events:

If Grace Period is set to "Yes" set Activity Log to "Ticket reopened because the associated job re-triggered with a status of <JobStatus> within the grace period. Message: <Message>"

If JobStatusCode is set to 5 (Success) set Activity Log to "Ticket closed by Oracle Enterprise Manager because the associated job has completed successfully."

Otherwise set Activity Log to "Ticket updated due to change in job status of <JobStatus>. Message: <Message>"


Table 5-3 shows Service Desk ticket attributes and corresponding Enterprise Manager alert attributes and values for CASD_Default_Incident.xsl mappings.

Table 5-3 Ticket Updates (CASD_Default_Incident.xsl Mappings)

Service Desk Ticket Attributes Enterprise Manager Alert Attributes Value

Identifier

TicketID - Extracts only the internal identifier from the ticket id

N/A

Summary

Message

N/A

Priority

Severity - Applies to metric alertsJobStatus - Applies to job status events

For metric alerts:

  • If severity is Critical, Unreachable Start or Agent Unreachable Start set Priority to Medium (3).

  • Otherwise, set Impact to Low (5).

For job status events:

  • If the JobStatus is Initialization Error, Failed, or Failed and Retried set Priority to High(1).

  • If the JobStatus is Skipped set Priority to Medium-High(2).

  • If the JobStatus is Scheduled, Running, or Queued set Priority to Low(1).

  • If the JobStatus is Success set Priority to None.

  • Otherwise, set Priority to Medium-Low(2).

Status

For metric alerts:

Grace Period

For job status events:

Grace Period

For metric alerts:

If Grace Period is set to "Yes" set Status to Open (OP).

Otherwise do not set Status.

For job status events:

If Grace Period is set to "Yes" set Status to Open (OP).

Otherwise do not set Status

Activity Log

For metric alerts:

Grace Period

Severity

Message

For job status events:

Grace Period

JobStatus

Message

For metric alerts:

If Grace Period is set to "Yes" set Activity Log to "Ticket reopened because the associated alert re-triggered at <Severity> severity within the grace period. Message: <Message>"

Otherwise set Activity Log to "Ticket updated due to change in severity of the associated alert. Severity: <Severity> Message: <Message>"

For job status events:

If Grace Period is set to "Yes" set Activity Log to "Ticket reopened because the associated job re-triggered with a status of <JobStatus> within the grace period. Message: <Message>"

Otherwise set Activity Log to "Ticket updated due to change in job status of <JobStatus>. Message: <Message>"


Use the mapping tables (Table 5-1 and Table 5-2) as a reference to read the XSLT file in .

Example 5-1 CASD_Default_Incident_AutoClose.xsl Source Code with Annotations

<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version="1.0" 
              xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              xmlns:ns0="http://xmlns.oracle.com/sysman/connector/tt">
 
  <!--
  This template creates an incident type ticket within CA Service Desk with default settings.
  On update, the ticket summary is updated with the latest event message and priority
  information as an activity log entry. 
  -->
  
  <xsl:template match="ns0:EventModel">
    <xsl:choose>
      <xsl:when test="normalize-space(ns0:TicketId) = ''">
        <!-- EDIT THE TAG VALUES BELOW TO CHANGE HOW A CASD INCIDENT IS FILLED DURING INCIDENT CREATION -->    
        <iwaveaf:create xmlns:iwaveaf="http://iwavesoftware.com/services/adapter-framework">
          <incident>
            <xsl:choose>
              <xsl:when test="ns0:EventType = 'Alert'">
                <!-- Set the CASD Incident Priority-->
                <!--     Possible values for priority: -->
                <!--       1 = High                    -->
                <!--       2 = Medium-High             -->
                <!--       3 = Medium                  -->
                <!--       4 = Medium-Low              -->
                <!--       5 = Low                     -->
                <!--       None                        -->
                <xsl:choose>
                  <!--  EM Critical -->
                  <xsl:when test="ns0:SeverityCode = '25'">  
                    <priority>3</priority> <!-- CASD Medium -->
                  </xsl:when>
                  <!--  EM Warning-->
                  <xsl:when test="ns0:SeverityCode = '20'"> 
                    <priority>5</priority>  <!-- CASD Low -->
                  </xsl:when>
                  <!--  Unreachable Start -->
                  <xsl:when test="ns0:Severity = 'Unreachable Start'">
                    <priority>3</priority> <!-- CASD Medium -->
                  </xsl:when>
                  <!--  Agent Unreachable Start -->
                  <xsl:when test="ns0:Severity = 'Agent Unreachable Start'"> 
                    <priority>3</priority> <!-- CASD Medium -->
                  </xsl:when>
                  <!--  Blackout Start -->
                  <xsl:when test="ns0:Severity = 'Blackout Start'">
                    <priority>5</priority>  <!-- CASD Low -->
                  </xsl:when>
                  <!--  Metric Error Start-->
                  <xsl:when test="ns0:Severity = 'Metric Error Start'"> 
                    <priority>5</priority>  <!-- CASD Low -->
                  </xsl:when>
                </xsl:choose>
 
                <!-- Set the CASD Incident Description -->
                <description>
Ticket created by EM CASD Connector.
--------------------------------------
EM User: <xsl:value-of select="ns0:EMUser"/>
Alert Information:
  Target Type: <xsl:value-of select="ns0:TargetType"/>
  Target Name: <xsl:value-of select="ns0:TargetName"/>
  Metric Column: <xsl:value-of select="ns0:MetricColumn"/>
  Metric Name: <xsl:value-of select="ns0:MetricName"/>
                  <!-- LIST ALL THE TARGET PROPERTIES -->
                  <xsl:for-each select="ns0:TargetProperties">
                  <xsl:text>&#xa;        </xsl:text>
                  <xsl:value-of select="./ns0:name"/>: <xsl:value-of select="./ns0:value"/>
                  </xsl:for-each>
                  <!-- EDIT THE FOLLOWING CODE TO LIST A SPECIFIC TARGET PROPERTY, 
                       SUCH AS "Line of Business"
             
                  <xsl:choose>
                  <xsl:when test="ns0:TargetProperties/ns0:name='Line of Business'">
                  Line of Business: <xsl:value-of select="ns0:TargetProperties/ns0:value"/>
                  </xsl:when>
                  </xsl:choose>
        
                  -->
                  <xsl:choose>
                    <xsl:when test="normalize-space(ns0:KeyColumn) != ''">
  Key Column: <xsl:value-of select="ns0:KeyColumn"/>
  Key Values: <xsl:value-of select="ns0:KeyValues"/>
                    </xsl:when>
                  </xsl:choose> 
  Severity: <xsl:value-of select="ns0:Severity"/>
  Collection Time: <xsl:value-of select="translate(ns0:CollectionTime, 'T', ' ')"/>
  Target Host: <xsl:value-of select="ns0:TargetHost"/>
                  <xsl:choose>
                    <xsl:when test="normalize-space(ns0:NotificationRuleName) != ''">
  Notification Rule: <xsl:value-of select="ns0:NotificationRuleName"/>
                    </xsl:when>
                  </xsl:choose>  
  URL: &lt;a href="<xsl:value-of select="ns0:EventPageURL"/>" target="_blank"&gt;<xsl:value-of select="ns0:EventPageURL"/>&lt;/a&gt;
                </description>
              </xsl:when>
 
              <xsl:when test="ns0:EventType = 'JobStatus'">
                <!-- Set the CASD Incident Priority-->
                <!--     Possible values for priority: -->
                <!--       1 = High                    -->
                <!--       2 = Medium-High             -->
                <!--       3 = Medium                  -->
                <!--       4 = Medium-Low              -->
                <!--       5 = Low                     -->
                <!--       None                        -->
                <xsl:choose>
                  <!--  EM Scheduled -->
                  <xsl:when test="ns0:JobStatusCode = '1'">  
                    <priority>5</priority> <!-- CASD Low -->
                  </xsl:when>
                  <!--  EM Running -->
                  <xsl:when test="ns0:JobStatusCode = '2'">  
                    <priority>5</priority> <!-- CASD Low -->
                  </xsl:when>
                  <!--  EM Initialization Error -->
                  <xsl:when test="ns0:JobStatusCode = '3'">  
                    <priority>1</priority> <!-- CASD High -->
                  </xsl:when>
                  <!--  EM Failed -->
                  <xsl:when test="ns0:JobStatusCode = '4'">  
                    <priority>1</priority> <!-- CASD High -->
                  </xsl:when>
                  <!--  EM Success -->
                  <xsl:when test="ns0:JobStatusCode = '5'">  
                    <priority>None</priority> <!-- CASD None -->
                  </xsl:when>
                  <!--  EM Suspended by User -->
                  <xsl:when test="ns0:JobStatusCode = '6'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Suspended on Agent Unreachable -->
                  <xsl:when test="ns0:JobStatusCode = '7'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Stopped -->
                  <xsl:when test="ns0:JobStatusCode = '8'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Suspended on Lock -->
                  <xsl:when test="ns0:JobStatusCode = '9'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Suspended on Event -->
                  <xsl:when test="ns0:JobStatusCode = '10'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Suspended on Blackout -->
                  <xsl:when test="ns0:JobStatusCode = '11'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Stop Pending -->
                  <xsl:when test="ns0:JobStatusCode = '12'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Suspend Pending -->
                  <xsl:when test="ns0:JobStatusCode = '13'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Inactive -->
                  <xsl:when test="ns0:JobStatusCode = '14'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Queued -->
                  <xsl:when test="ns0:JobStatusCode = '15'">  
                    <priority>5</priority> <!-- CASD Low -->
                  </xsl:when>
                  <!--  EM Failed and Retried -->
                  <xsl:when test="ns0:JobStatusCode = '16'">  
                    <priority>1</priority> <!-- CASD High -->
                  </xsl:when>
                  <!--  EM Waiting -->
                  <xsl:when test="ns0:JobStatusCode = '17'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Skipped -->
                  <xsl:when test="ns0:JobStatusCode = '18'">  
                    <priority>2</priority> <!-- CASD Medium-High -->
                  </xsl:when>
                </xsl:choose>
 
                <!-- Set the CASD Incident Description -->
                <description>
Ticket created by EM CASD Connector.
--------------------------------------
EM User: <xsl:value-of select="ns0:EMUser"/>
        
Event Information:
  Job Name: <xsl:value-of select="ns0:JobName"/>
  Job Type: <xsl:value-of select="ns0:JobType"/>
  Job Owner: <xsl:value-of select="ns0:JobOwner"/>
  Job Status: <xsl:value-of select="ns0:JobStatus"/>
                  <xsl:choose>
                    <xsl:when test="ns0:JobTarget">
  Job Target: <xsl:for-each select="ns0:JobTarget">
                <xsl:value-of select="./ns0:TargetName"/>(<xsl:value-of select="./ns0:TargetType"/>);
              </xsl:for-each>
                    </xsl:when>
                  </xsl:choose>
  Collection Time: <xsl:value-of select="translate(ns0:CollectionTime, 'T', ' ')"/>
                  <xsl:choose>
                    <xsl:when test="normalize-space(ns0:NotificationRuleName) != ''">
  Notification Rule: <xsl:value-of select="ns0:NotificationRuleName"/>
                    </xsl:when>
                  </xsl:choose>  
  URL: &lt;a href="<xsl:value-of select="ns0:EventPageURL"/>" target="_blank"&gt;<xsl:value-of select="ns0:EventPageURL"/>&lt;/a&gt;
                </description>
              </xsl:when>
            </xsl:choose>
 
            <!-- Set the CASD Incident Reported By -->
            <!-- This field is defaulted to Administrator but can be changed to any to any valid -->
            <!-- CASD account. A lookup will be performed based on the first, middle and last names. -->
            <customer>
              <firstName></firstName>
              <middleName></middleName>
              <lastName>Administrator</lastName>
            </customer>
 
            <!-- Set the CASD Incident Summary -->
            <summary><xsl:value-of select="ns0:Message"/></summary>
 
            <!-- Add a CASD Activity log entry -->
            <logs>
              <log>
                <xsl:choose>
                  <xsl:when test="ns0:EventType = 'JobStatus'">
                <description>Ticket created by Oracle Enterprise Manager Connector for CA Service Desk based on a job with a status of <xsl:value-of select="ns0:JobStatus"/>. Message: <xsl:value-of select="ns0:Message"/></description>
                  </xsl:when>
                  <xsl:otherwise>
                <description>Ticket created by Oracle Enterprise Manager Connector for CA Service Desk based on an alert with <xsl:value-of select="ns0:Severity"/> severity. Message: <xsl:value-of select="ns0:Message"/></description>
                  </xsl:otherwise>
                </xsl:choose>
              </log>
            </logs>
 
        <!--  UNCOMMENT THE TAGS YOU WISH TO HAVE MODIFIED WHENEVER   -->
        <!--  THE INCIDENT IS CREATED, AND GIVE THEM DESIRED VALUES   --> 
 
            <!-- <status></status> -->
            <!--     Possible values for status: -->
            <!--         ACK (Acknowledged) -->
            <!--         CL (Closed) -->
            <!--         OP (Open) -->
            <!--         WIP (Work In Progress) -->
            <!--         AVOID (Avoided) -->
            <!--         FIP (Fix in Progress) -->
            <!--         CLREQ (Close Requested) -->
            <!--         KE (Known Error) -->
            <!--         CNCL (Cancelled) -->
            <!--         HOLD (Hold) -->
            <!--         CLUNRSLV (Closed-Unresolved) -->
            <!--         PRBAPP (Problem-Approved) -->
            <!--         PC (Problem-Closed) -->
            <!--         PF (Problem-Fixed) -->
            <!--         PRBANCOMP (Problem-Analysis Complete) -->
            <!--         PO (Problem-Open) -->
            <!--         RSCH (Researching) -->
            <!--         RE (Resolved) -->
            <!--         PRBREJ (Problem-Rejected) -->
 
            <!-- <impact></impact> -->
            <!--     Possible values for impact: -->
            <!--         1-Entire Organization -->
            <!--         2-Multiple Groups -->
            <!--         3-Single Group -->
            <!--         4-Small Group -->
            <!--         5-One person -->
            <!--         None -->
 
            <!-- <urgency></urgency> -->
            <!--     Possible values for urgency: -->
            <!--         1-As Possible -->
            <!--         2-Soon -->
            <!--         3-Quickly -->
            <!--         4-Very Quickly -->
            <!--         5-Immediate -->
 
            <!-- <severity></severity> -->
            <!--     Possible values for severity: -->
            <!--         1-Escalated -->
            <!--         2-Superviser Escal. -->
            <!--         3-Mgr Escal. -->
            <!--         4-HD Mgr Escalation -->
            <!--         5-All Hands Escalation -->
 
          </incident>
        </iwaveaf:create>
      </xsl:when>
      <xsl:otherwise>
        <iwaveaf:update xmlns:iwaveaf="http://iwavesoftware.com/services/adapter-framework">
          <incident>
            <identifier><xsl:value-of select="normalize-space(substring-before(substring-after(ns0:TicketId, '('), ')'))"/></identifier>
            <summary><xsl:value-of select="ns0:Message"/></summary>
            <xsl:choose>
              <!-- Set the CASD Incident Priority-->
              <!--     Possible values for priority: -->
              <!--       1 = High                    -->
              <!--       2 = Medium-High             -->
              <!--       3 = Medium                  -->
              <!--       4 = Medium-Low              -->
              <!--       5 = Low                     -->
              <!--       None                        -->
              <xsl:when test="ns0:EventType = 'Alert'">
                <xsl:choose>
                  <!--  EM Critical -->
                  <xsl:when test="ns0:SeverityCode = '25'">  
                    <priority>3</priority> <!-- CASD Medium -->
                  </xsl:when>
                  <!--  EM Warning-->
                  <xsl:when test="ns0:SeverityCode = '20'"> 
                    <priority>5</priority>  <!-- CASD Low -->
                  </xsl:when>
                  <!--  Unreachable Start -->
                  <xsl:when test="ns0:Severity = 'Unreachable Start'">
                    <priority>3</priority> <!-- CASD Medium -->
                  </xsl:when>
                  <!--  Agent Unreachable Start -->
                  <xsl:when test="ns0:Severity = 'Agent Unreachable Start'"> 
                    <priority>3</priority> <!-- CASD Medium -->
                  </xsl:when>
                  <!--  Blackout Start -->
                  <xsl:when test="ns0:Severity = 'Blackout Start'">
                    <priority>5</priority>  <!-- CASD Low -->
                  </xsl:when>
                  <!--  Metric Error Start-->
                  <xsl:when test="ns0:Severity = 'Metric Error Start'"> 
                    <priority>5</priority>  <!-- CASD Low -->
                  </xsl:when>
                </xsl:choose>
              </xsl:when>
 
              <xsl:when test="ns0:EventType = 'JobStatus'">
                <xsl:choose>
                  <!--  EM Scheduled -->
                  <xsl:when test="ns0:JobStatusCode = '1'">  
                    <priority>5</priority> <!-- CASD Low -->
                  </xsl:when>
                  <!--  EM Running -->
                  <xsl:when test="ns0:JobStatusCode = '2'">  
                    <priority>5</priority> <!-- CASD Low -->
                  </xsl:when>
                  <!--  EM Initialization Error -->
                  <xsl:when test="ns0:JobStatusCode = '3'">  
                    <priority>1</priority> <!-- CASD High -->
                  </xsl:when>
                  <!--  EM Failed -->
                  <xsl:when test="ns0:JobStatusCode = '4'">  
                    <priority>1</priority> <!-- CASD High -->
                  </xsl:when>
                  <!--  EM Success -->
                  <xsl:when test="ns0:JobStatusCode = '5'">  
                    <priority>None</priority> <!-- CASD None -->
                  </xsl:when>
                  <!--  EM Suspended by User -->
                  <xsl:when test="ns0:JobStatusCode = '6'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Suspended on Agent Unreachable -->
                  <xsl:when test="ns0:JobStatusCode = '7'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Stopped -->
                  <xsl:when test="ns0:JobStatusCode = '8'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Suspended on Lock -->
                  <xsl:when test="ns0:JobStatusCode = '9'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Suspended on Event -->
                  <xsl:when test="ns0:JobStatusCode = '10'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Suspended on Blackout -->
                  <xsl:when test="ns0:JobStatusCode = '11'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Stop Pending -->
                  <xsl:when test="ns0:JobStatusCode = '12'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Suspend Pending -->
                  <xsl:when test="ns0:JobStatusCode = '13'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Inactive -->
                  <xsl:when test="ns0:JobStatusCode = '14'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Queued -->
                  <xsl:when test="ns0:JobStatusCode = '15'">  
                    <priority>5</priority> <!-- CASD Low -->
                  </xsl:when>
                  <!--  EM Failed and Retried -->
                  <xsl:when test="ns0:JobStatusCode = '16'">  
                    <priority>1</priority> <!-- CASD High -->
                  </xsl:when>
                  <!--  EM Waiting -->
                  <xsl:when test="ns0:JobStatusCode = '17'">  
                    <priority>4</priority> <!-- CASD Medium-Low -->
                  </xsl:when>
                  <!--  EM Skipped -->
                  <xsl:when test="ns0:JobStatusCode = '18'">  
                    <priority>2</priority> <!-- CASD Medium-High -->
                  </xsl:when>
                </xsl:choose>
              </xsl:when>
            </xsl:choose>
 
        <!--  UNCOMMENT THE TAGS YOU WISH TO HAVE MODIFIED WHENEVER   -->
        <!--  THE INCIDENT IS UPDATED, AND GIVE THEM DESIRED VALUES   --> 
 
            <!-- <status></status> -->
            <!--     Possible values for status: -->
            <!--         ACK (Acknowledged) -->
            <!--         CL (Closed) -->
            <!--         OP (Open) -->
            <!--         WIP (Work In Progress) -->
            <!--         AVOID (Avoided) -->
            <!--         FIP (Fix in Progress) -->
            <!--         CLREQ (Close Requested) -->
            <!--         KE (Known Error) -->
            <!--         CNCL (Cancelled) -->
            <!--         HOLD (Hold) -->
            <!--         CLUNRSLV (Closed-Unresolved) -->
            <!--         PRBAPP (Problem-Approved) -->
            <!--         PC (Problem-Closed) -->
            <!--         PF (Problem-Fixed) -->
            <!--         PRBANCOMP (Problem-Analysis Complete) -->
            <!--         PO (Problem-Open) -->
            <!--         RSCH (Researching) -->
            <!--         RE (Resolved) -->
            <!--         PRBREJ (Problem-Rejected) -->
 
            <!-- <impact></impact> -->
            <!--     Possible values for impact: -->
            <!--         1-Entire Organization -->
            <!--         2-Multiple Groups -->
            <!--         3-Single Group -->
            <!--         4-Small Group -->
            <!--         5-One person -->
            <!--         None -->
 
            <!-- <urgency></urgency> -->
            <!--     Possible values for urgency: -->
            <!--         1-As Possible -->
            <!--         2-Soon -->
            <!--         3-Quickly -->
            <!--         4-Very Quickly -->
            <!--         5-Immediate -->
 
            <!-- <severity></severity> -->
            <!--     Possible values for severity: -->
            <!--         1-Escalated -->
            <!--         2-Superviser Escal. -->
            <!--         3-Mgr Escal. -->
            <!--         4-HD Mgr Escalation -->
            <!--         5-All Hands Escalation -->
 
            <!-- <resolution>
                   <resolutionDate></resolutionDate>
                 </resolution> -->
            <!-- Resolution date must be formatted using the ISO 8601 format code. -->
            <!--     Sample format: 2009-11-24T09:57:01Z -->
            <!--     Sample format: 2009-11-24T03:57:01-06:00 -->
 
            <xsl:choose>
              <!-- Handle update caused by Alert Status change -->
              <xsl:when test="ns0:EventType = 'Alert'">
                <xsl:choose>
                  <xsl:when test="ns0:GracePeriodCheckMade = 'Yes'">
                    <!-- Set the CASD Incident Status back to Open -->
                    <status>OP</status>
 
                    <!-- Add a CASD Activity log entry -->
                    <logs>
                      <log>
                        <description>Ticket reopened because the associated alert re-triggered at <xsl:value-of select="ns0:Severity"/> severity within the grace period. Message: <xsl:value-of select="ns0:Message"/></description>
                      </log>
                    </logs>
                  </xsl:when>
 
                  <!-- Close the incident if the EM Severity is set to one of the following. -->
                  <!--     Clear -->
                  <!--     Unreachable Clear -->
                  <!--     Agent Unreachable Clear -->
                  <!--     Blackout End -->
                  <!--     Metric Error Clear -->
                  <xsl:when test="ns0:SeverityCode = '15'
                    or ns0:Severity = 'Unreachable Clear'
                    or ns0:Severity = 'Agent Unreachable Clear'
                    or ns0:Severity = 'Blackout End'
                    or ns0:Severity = 'Metric Error End'"> 
                    <!-- Set the CASD Incident Status to Closed -->
                    <status>CL</status>
 
                    <!-- Add a CASD Activity log entry -->
                    <logs>
                      <log>
                        <description>Ticket closed by Oracle Enterprise Manager because the associated alert has been cleared.</description>
                      </log>
                    </logs>
                  </xsl:when>
 
                  <xsl:otherwise>
                    <!-- Add activity log entry with a standard update message since this is not a reopen.-->
                    <logs>
                      <log>
                        <description>Ticket updated due to change in severity of the associated alert. Severity:  <xsl:value-of select="ns0:Severity"/>  Message:  <xsl:value-of select="ns0:Message"/></description>
                      </log>
                    </logs>
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:when>
 
              <!-- Handle update caused by Job Status change -->
              <xsl:when test="ns0:EventType = 'JobStatus'">
                <xsl:choose>
                  <xsl:when test="ns0:GracePeriodCheckMade = 'Yes'">
                    <!-- Set the CASD Incident Status back to Open -->
                    <status>OP</status>
 
                    <!-- Add a CASD Activity log entry -->
                    <logs>
                      <log>
                        <description>Ticket reopened because the associated job re-triggered with a status of <xsl:value-of select="ns0:JobStatus"/> within the grace period. Message: <xsl:value-of select="ns0:Message"/></description>
                      </log>
                    </logs>
                  </xsl:when>
 
                  <!-- Close the incident if the job succeeded -->
                  <xsl:when test="ns0:JobStatusCode = '5'">
                    <!-- Set the CASD Incident Status to Closed -->
                    <status>CL</status>
 
                    <!-- Add a CASD Activity log entry -->
                    <logs>
                      <log>
                        <description>Ticket closed by Oracle Enterprise Manager because the associated job has completed successfully.</description>
                      </log>
                    </logs>
                  </xsl:when>
 
                  <xsl:otherwise>
                    <!-- Add activity log entry with a standard update message since this is not a reopen.-->
                    <logs>
                      <log>
                        <description>Ticket updated due to change in job status of <xsl:value-of select="ns0:JobStatus"/>.  Message:  <xsl:value-of select="ns0:Message"/></description>
                      </log>
                    </logs>
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:when>
            </xsl:choose>                           
          </incident>
        </iwaveaf:update>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
</xsl:stylesheet>

Customizing Ticket Templates

If the out-of-box ticket templates do not satisfy your requirements, you can modify them. To do this, Oracle recommends that you use one of the existing templates as the base template. Copy this ticket template to a new file, modify, and register the new ticket template.

In most cases, when you modify the ticket template, you might only be changing the mappings. The following examples illustrate this point:

Example 5-2: Creating a Template to set the Urgency Element

By default the Urgency field is not set whenever an incident is created in Service Desk. Both out-of-box templates have an urgency element commented out that can be used to set the urgency field. To create a template to set the Urgency to Soon, copy one of the default templates to a new file. Edit the new file and uncomment the urgency element in the template setting the contents to 2-Soon as shown below. Register the new ticket template. The template is now ready to use in notification rules or as a template for manual ticket creation.

<urgency>2-Soon</urgency>

Example 5-3: Altering the Message Type

If you only want the alert message to appear as ticket summary instead of both message and severity, copy one of the default templates to a new file, modify the following attribute and register.

<summary><xsl:value-of select="ns0:Message"/></summary>

The templates are highly customizable. Oracle recommends that only users with advanced knowledge of XSLT make complex changes.

You can use notification rules as a filter to associate proper ticket templates with alerts. You can have as many tickets templates as you want. One notification rule can have only one ticket template.