Difference between revisions of "Count Ticket Reopens"

From SDU
Jump to: navigation, search
m (Modified links)
m
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
[[Category:Customizations]]
 +
{{Global Header}}
 +
{{Global Announcement}}
 +
 +
== Overview ==
 
This article provides instructions for calculating the number of times a ticket is reopened.  
 
This article provides instructions for calculating the number of times a ticket is reopened.  
  
== Step 1. Create new field ==
+
== Procedures ==
 +
=== Step 1. Create new field ===
 
The methods used to create new tables columns vary based on the Service Desk release.[[Image:Reopen count.GIF|thumb|r11.x Screenshot - Add Column]]
 
The methods used to create new tables columns vary based on the Service Desk release.[[Image:Reopen count.GIF|thumb|r11.x Screenshot - Add Column]]
  
<font color="blue">For r11.x releases</font>, follow these steps:
+
''For r11.x releases'', follow these steps:
 
#Launch the Web Screen Painter then the Schema Designer
 
#Launch the Web Screen Painter then the Schema Designer
 
#Add a column per the image to the right.
 
#Add a column per the image to the right.
Line 13: Line 19:
 
#Start the Service Desk service
 
#Start the Service Desk service
  
 +
''For older release'', follow these steps:
  
 
+
1. Create a [[.sch file]] with the following syntax and place it in the [[$NX_ROOT]]/site/mods directory. Name the [[.sch file|.sch]] anything you like, but it is recommended that it be preceded with a 'z'.
<font color="blue">For older release</font>, follow these steps:
+
 
+
1. Create a [[.sch file]] with the following syntax and place it in the [[NX_ROOT]]/site/mods directory. Name the [[.sch file|.sch]] anything you like, but it is recommended that it be preceded with a 'z'.
+
 
<source lang="javascript">// Use TABLE Call_Req for Requests, Incidents & Problems
 
<source lang="javascript">// Use TABLE Call_Req for Requests, Incidents & Problems
 
// Use TABLE Change_Request for Change Orders
 
// Use TABLE Change_Request for Change Orders
Line 25: Line 29:
 
}</source>
 
}</source>
  
2. Create a [[.mod file]] with the following syntax and place it in the [[NX_ROOT]]/site/mods/majic directory. Name the [[.mod file|.mod]] anything you like, but it is recommended that it be preceded with a 'z'.
+
2. Create a [[.mod file]] with the following syntax and place it in the [[$NX_ROOT]]/site/mods/majic directory. Name the [[.mod file|.mod]] anything you like, but it is recommended that it be preceded with a 'z'.
 
<source lang="javascript">// Use OBJECT cr and ATTRIBUTE Call_Req for Requests, Incidents & Problems
 
<source lang="javascript">// Use OBJECT cr and ATTRIBUTE Call_Req for Requests, Incidents & Problems
 
// Use OBJECT chg and ATTRIBUTE Change_Request for Change Orders
 
// Use OBJECT chg and ATTRIBUTE Change_Request for Change Orders
Line 50: Line 54:
 
  pdm_load -f Call_Req.txt -v
 
  pdm_load -f Call_Req.txt -v
  
 
+
=== Step 2. Create the script ===
== Step 2. Create the script ==
+
A script is created as an [[.spl file]] and placed in the [[$NX_ROOT]]/site/mods/majic directory. When the Service Desk service starts, the contents of the majic directory are processed and cached. You can use any naming scheme you like for your [[.spl file]], but it is recommended that the file be preceded with a 'z' for easy identification as a custom file (eg zMyCompany.spl, zcr_scripts.spl, zMyScripts.spl).
A script is created as an [[.spl file]] and placed in the [[NX_ROOT]]/site/mods/majic directory. When the Service Desk service starts, the contents of the majic directory are processed and cached. You can use any naming scheme you like for your [[.spl file]], but it is recommended that the file be preceded with a 'z' for easy identification as a custom file (eg zMyCompany.spl, zcr_scripts.spl, zMyScripts.spl).
+
  
 
<source lang="javascript">// Use 'cr' for Requests, Incidents & Problems, 'chg' for Changes, and 'iss' for Issues
 
<source lang="javascript">// Use 'cr' for Requests, Incidents & Problems, 'chg' for Changes, and 'iss' for Issues
 
cr::zmyscript(...) {
 
cr::zmyscript(...) {
string zmsg;
 
// Enter an if statement
 
 
int i, n;
 
int i, n;
 
if (is_null(zreopen_count)) {
 
if (is_null(zreopen_count)) {
Line 65: Line 66:
 
}
 
}
 
n = i + 1;
 
n = i + 1;
send_wait(0, this, "call_attr", "zreopen_count", "set_val", n, "SURE_SET");</source>
+
send_wait(0, this, "call_attr", "zreopen_count", "set_val", n, "SURE_SET");
 +
}</source>
  
 
+
=== Step 3. Create the trigger ===
== Step 3. Create the trigger ==
+
 
This step is to create the trigger that will initiate the script. The methods used to implement the trigger vary based on the Service Desk release.  
 
This step is to create the trigger that will initiate the script. The methods used to implement the trigger vary based on the Service Desk release.  
  
 +
''For r11.x releases'' triggers are created via the [[Schema Designer]] utility. Simply add the following code as a [[Site-Defined Trigger]] to the '''[[Call Req Table|cr (Request)]]''', '''[[Change Request Table|chg (Change Order)]]''', or '''[[Issue Table|iss (Issue)]]''' table.
 +
PRE_VALIDATE zmyscript() 111 FILTER(active{->1});
  
<font color="blue">For r11.x releases</font> triggers are created via the [[Schema Designer]] utility. Simply add the following code as a [[Site-Defined Trigger]] to the '''[[Call Req Table|cr (Request)]]''', '''[[Change Request Table|chg (Change Order)]]''', or '''[[Issue Table|iss (Issue)]]''' table.
+
''For older releases'' triggers are made by creating a [[.mod file]] and placing it in the [[$NX_ROOT]]/site/mods/majic directory. Name the [[.mod file|.mod]] anything you like, but it is recommended that it be preceded with a 'z'.
PRE_VALIDATE zmyscript() 111 FILTER((active{->1});
+
 
+
 
+
<font color="blue">For older releases</font> triggers are made by creating a [[.mod file]] and placing it in the [[NX_ROOT]]/site/mods/majic directory. Name the [[.mod file|.mod]] anything you like, but it is recommended that it be preceded with a 'z'.
+
  
 
<source lang="javascript">// Use OBJECT cr for Requests, Incidents & Problems
 
<source lang="javascript">// Use OBJECT cr for Requests, Incidents & Problems
Line 83: Line 82:
 
OBJECT cr {
 
OBJECT cr {
 
   TRIGGERS {
 
   TRIGGERS {
     POST_VALIDATE zmyscript() 111 FILTER((active{->1});
+
     POST_VALIDATE zmyscript() 111 FILTER(active{->1});
 
   };
 
   };
 
};</source>
 
};</source>
  
== Step 4. Publish the Schema changes ==
+
=== Step 4. Publish the Schema changes ===
 
The methods used to publish schema changes vary based on the Service Desk release.
 
The methods used to publish schema changes vary based on the Service Desk release.
  
<font color="blue">For r11.x releases</font>, follow these steps:
+
''For r11.x releases'', follow these steps:
 
#Save your Schema changes
 
#Save your Schema changes
 
#Stop the Service Desk service
 
#Stop the Service Desk service
Line 96: Line 95:
 
#Start the Service Desk service
 
#Start the Service Desk service
  
<font color="blue">For older release</font> recycle the Service Desk service.
+
''For older release'' recycle the Service Desk service.
 
+
 
+
----
+
<div align='center'><font color="red">To make corrections or additions to this article, select the ''edit'' tab above.<br>
+
To discuss or ask questions about this article, select the ''discussion'' tab above.</font></div>
+
 
+
[[Category:Customizations]]
+

Latest revision as of 03:27, 27 July 2008

To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

Overview

This article provides instructions for calculating the number of times a ticket is reopened.

Procedures

Step 1. Create new field

The methods used to create new tables columns vary based on the Service Desk release.
r11.x Screenshot - Add Column

For r11.x releases, follow these steps:

  1. Launch the Web Screen Painter then the Schema Designer
  2. Add a column per the image to the right.
  3. Save and Publish your Schema changes
  4. Stop the Service Desk service
  5. Run pdm_publish from a command line
  6. Start the Service Desk service

For older release, follow these steps:

1. Create a .sch file with the following syntax and place it in the $NX_ROOT/site/mods directory. Name the .sch anything you like, but it is recommended that it be preceded with a 'z'. <source lang="javascript">// Use TABLE Call_Req for Requests, Incidents & Problems // Use TABLE Change_Request for Change Orders // Use TABLE Issue for Issues TABLE Call_Req {

 zreopen_count	INTEGER;

}</source>

2. Create a .mod file with the following syntax and place it in the $NX_ROOT/site/mods/majic directory. Name the .mod anything you like, but it is recommended that it be preceded with a 'z'. <source lang="javascript">// Use OBJECT cr and ATTRIBUTE Call_Req for Requests, Incidents & Problems // Use OBJECT chg and ATTRIBUTE Change_Request for Change Orders // Use OBJECT iss and ATTRIBUTE Issue for Issues OBJECT cr {

 ATTRIBUTES Call_Req {
   zreopen_count INTEGER
     {
     ON_NEW DEFAULT "0";
     };
  };

};</source> 3. Run a pdm_extract command of the target table. Example:

pdm_extract Call_Req > Call_Req.txt

4. Run the Configuration Utility and do not start the Service Desk services.

5. Run a build command of the target table. Example:

sqlbuild -p Call_Req AHD "C:\Program Files\CA\Unicenter ServicePlus Service Desk\site\ddict.sch"

6. Start the Service Desk services

7. Run a pdm_load command of the previously extracted data. Example:

pdm_load -f Call_Req.txt -v

Step 2. Create the script

A script is created as an .spl file and placed in the $NX_ROOT/site/mods/majic directory. When the Service Desk service starts, the contents of the majic directory are processed and cached. You can use any naming scheme you like for your .spl file, but it is recommended that the file be preceded with a 'z' for easy identification as a custom file (eg zMyCompany.spl, zcr_scripts.spl, zMyScripts.spl).

<source lang="javascript">// Use 'cr' for Requests, Incidents & Problems, 'chg' for Changes, and 'iss' for Issues cr::zmyscript(...) { int i, n; if (is_null(zreopen_count)) { i = 0; } else { i = zreopen_count; } n = i + 1; send_wait(0, this, "call_attr", "zreopen_count", "set_val", n, "SURE_SET"); }</source>

Step 3. Create the trigger

This step is to create the trigger that will initiate the script. The methods used to implement the trigger vary based on the Service Desk release.

For r11.x releases triggers are created via the Schema Designer utility. Simply add the following code as a Site-Defined Trigger to the cr (Request), chg (Change Order), or iss (Issue) table.

PRE_VALIDATE zmyscript() 111 FILTER(active{->1});

For older releases triggers are made by creating a .mod file and placing it in the $NX_ROOT/site/mods/majic directory. Name the .mod anything you like, but it is recommended that it be preceded with a 'z'.

<source lang="javascript">// Use OBJECT cr for Requests, Incidents & Problems // Use OBJECT chg for Change Orders // Use OBJECT iss for Issues OBJECT cr {

 TRIGGERS {
   POST_VALIDATE zmyscript() 111 FILTER(active{->1});
 };

};</source>

Step 4. Publish the Schema changes

The methods used to publish schema changes vary based on the Service Desk release.

For r11.x releases, follow these steps:

  1. Save your Schema changes
  2. Stop the Service Desk service
  3. Run pdm_publish from a command line
  4. Start the Service Desk service

For older release recycle the Service Desk service.