This article demonstrates how to use FocalScope Categories as custom fields and how to generate a report for categorized tickets using the SOAP API.
For the sake of demonstration we will create three categories. The first, Work Number, will be used as a custom field to hold numerous unique dynamic values. It is required to tick the [dynamic values (skip prompt)] flag for this category (see the article How to configure and use FocalScope's Ticket Categories for more information) to ensure the best user experience and optimal system performance. The other two categories will be regular categories used to illustrate how categories can be used as columns in reports.
To continue with the example, please follow these steps:
We will now generate a report filtered by the Work Number category with the Status and Query Types categories serving as report columns. The report will contain all tickets with work numbers assigned to them.
Please note: It is required to do some simple programming to generate the report. The code sample provided below is in C# programming language and utilizes .NET framework to make a SOAP call.
To use SOAP to generate a statistical report for categorized FocalScope tickets, do the following:
Figure 2 - Generating a SOAP query
using System;
using System.Text;
using System.Data;
using System.Xml;
namespace ConsoleSoapClient
{
class Program
{
static void Main(string[] args)
{
SoapService.SoapApi soapService = new SoapService.SoapApi();
soapService.Url = "http://localhost/emm/net/SoapApi.asmx";
string secToken = "679ce3a602e862b4b8dab94cada958d8";
string sCatNameFilter = "Work number";
string[] rgCatValFilter = { "ID10014", "ID10015" };
string[] rgCategoryColumns = {"Work number", "Status", "Query type" };
DataSet ds = new DataSet();
ds = soapService.QueryEmailTicket(secToken, sCatNameFilter, rgCatValFilter, rgCategoryColumns);
XmlTextWriter writer = new XmlTextWriter("res.xml", null);
writer.Formatting = Formatting.Indented;
ds.WriteXml(writer);
}
}
}
0 Comments