Pārlūkot izejas kodu

Sample data for triggers and actions

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@272 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 15 gadi atpakaļ
vecāks
revīzija
6e93e5045b

+ 10 - 0
setup/data/structure/23.triggers.xml

@@ -4,4 +4,14 @@
 <description>Incident Creation</description>
 <target_class>bizIncidentTicket</target_class>
 </TriggerOnObjectCreate>
+<TriggerOnStateEnter id="5">
+<description>Incident ticket assigned to agent</description>
+<target_class>bizIncidentTicket</target_class>
+<state>Assigned</state>
+</TriggerOnStateEnter>
+<TriggerOnStateEnter id="6">
+<description>Incident ticket resolved</description>
+<target_class>bizIncidentTicket</target_class>
+<state>Resolved</state>
+</TriggerOnStateEnter>
 </Set>

+ 61 - 19
setup/data/structure/24.actions.xml

@@ -1,21 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Set>
-<ActionEmail id="1">
-<name>Simple eMail</name>
-<description>Default eMail action, tailor it to fit your needs</description>
-<from></from>
-<reply_to></reply_to>
-<to>SELECT bizContact AS C WHERE C.id = :this-&gt;caller_id</to>
-<cc></cc>
-<bcc></bcc>
-<subject>New iTop ticket [$this-&gt;severity$]: $this-&gt;name$, $this-&gt;title$</subject>
-<body>&lt;h1&gt;A new iTop incident has been created: $this-&gt;name$&lt;/h1&gt;
+<?xml version="1.0" encoding="UTF-8"?>
+<Set>
+<ActionEmail id="4">
+<name>Incident Notification to a Workgroup</name>
+<description>This action informs a team that a ticket has been assigned their workgroup</description>
+<from></from>
+<reply_to></reply_to>
+<to>SELECT bizTeam AS t JOIN bizWorkgroup AS w ON w.team_id = t.id WHERE w.id=:this-&gt;workgroup_id</to>
+<cc></cc>
+<bcc></bcc>
+<subject>The ticket $this-&gt;name()$, severity $this-&gt;severity$ has been assigned to the workgroup $this-&gt;workgroup_name$</subject>
+<body>&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;The incident ticket $this-&gt;name()$ has been assigned to the workgroup $this-&gt;workgroup_name$.&lt;/p&gt;
 &lt;p&gt;Description: $this-&gt;title$&lt;/p&gt;
-&lt;p&gt;Initial situation: &lt;pre&gt;$this-&gt;initial_situation$&lt;/pre&gt;&lt;/p&gt;
-&lt;p&gt;Ticket Type: $this-&gt;type$&lt;/p&gt;
-&lt;p&gt;Ticket assigned to: $this-&gt;workgroup_name$&lt;/p&gt;
+&lt;p&gt;Initial Situation: $this-&gt;initial_situation$&lt;/p&gt;
 &lt;hr/&gt;
-&lt;p&gt;More information: $this-&gt;hyperlink()$&lt;/p&gt;</body>
-<importance>normal</importance>
-</ActionEmail>
-</Set>
+&lt;p&gt;for more information on this ticket, click here: $this-&gt;hyperlink()$&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;</body>
+<importance>normal</importance>
+</ActionEmail>
+<ActionEmail id="2">
+<name>Incident notification to Agent</name>
+<description>This action informs an agent that a ticket has been assigned to her/him</description>
+<from></from>
+<reply_to></reply_to>
+<to>SELECT bizPerson WHERE id=:this-&gt;agent_id</to>
+<cc></cc>
+<bcc></bcc>
+<subject>The ticket $this-&gt;name()$, severity $this-&gt;severity$ has been assigned to you</subject>
+<body>&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;The incident ticket $this-&gt;name()$ has been assigned to you.&lt;/p&gt;
+&lt;p&gt;Description: $this-&gt;title$&lt;/p&gt; 
+&lt;p&gt;Initial Situation: $this-&gt;initial_situation$&lt;/p&gt;
+&lt;hr/&gt;
+&lt;p&gt;for more information on this ticket, click here: $this-&gt;hyperlink()$&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;</body>
+<importance>normal</importance>
+</ActionEmail>
+<ActionEmail id="3">
+<name>Incident Notification to caller</name>
+<description>This action is used to inform the caller</description>
+<from></from>
+<reply_to></reply_to>
+<to>SELECT bizPerson WHERE id=:this-&gt;caller_id</to>
+<cc></cc>
+<bcc></bcc>
+<subject>Ticket $this-&gt;name()$, severity $this-&gt;severity$ - $this-&gt;ticket_status$</subject>
+<body>&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;The incident ticket $this-&gt;name()$ has changed to status $this-&gt;ticket_status$&lt;/p&gt;
+&lt;p&gt;Current situation: $this-&gt;current_situation$&lt;/p&gt;
+&lt;p&gt;Last update: $this-&gt;last_update$&lt;/p&gt;
+&lt;hr/&gt;
+&lt;p&gt;for more information on this ticket, click here: $this-&gt;hyperlink()$&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;</body>
+<importance>normal</importance>
+</ActionEmail>
+</Set>

+ 23 - 0
setup/data/structure/25.trigger-actions.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Set>
+<lnkTriggerAction id="4">
+<action_id>2</action_id>
+<trigger_id>5</trigger_id>
+<order>1</order>
+</lnkTriggerAction>
+<lnkTriggerAction id="5">
+<action_id>3</action_id>
+<trigger_id>5</trigger_id>
+<order>2</order>
+</lnkTriggerAction>
+<lnkTriggerAction id="6">
+<action_id>3</action_id>
+<trigger_id>6</trigger_id>
+<order>1</order>
+</lnkTriggerAction>
+<lnkTriggerAction id="7">
+<action_id>4</action_id>
+<trigger_id>2</trigger_id>
+<order>1</order>
+</lnkTriggerAction>
+</Set>