The net.dante.otrs.OTRSProducer JAVA class takes from one to three parameters, depending on the functionality required. Examples are as follows:
net.dante.otrs.OTRSProducer 60 - the number of minutes to subtract from the current time, in order to determine the date and time range of the tickets required.
net.dante.otrs.OTRSProducer 60 Yes - the number of minutes to subtract from the current time, in order to determine the date and time range of the tickets required. The second parameter can be either Yes or No and indicates whether you wish to select only Emergency, Planned and Internal maintenance tickets
net.dante.otrs.OTRSProducer "2017-09-01 00:00:00" "2017-09-30 23:59:59" Yes - The first two parameters determines the date and time range of the search. The third parameter can be either Yes or No and indicates whether you wish to select only Emergency, Planned and Internal maintenance tickets
*** Please notice the quotation marks around the date and time because of the space between the date and the time part.
In a nutshell, the OTRSProducer, queries the OTRS system for all maintenance tickets that were updated in the last 60 minutes. It retrieves those tickets and creates XML messages within the Enterprise Service Bus in the OTRS queue. Once it has completed it's processing, a Consumer, OTRSConsumer, processes the message within the OTRS queue
The class uses the standard AuditLog class to write log message to /tmp/otrs/OTRSProducer-YYYYMMDD.log. The location and name of the log file is configurable from within the otrs.properties file
The OTRS system has a generic SOAP based web service that allows users to search and retrieve Ticket information from the system. When a search is executed, a list of Ticket Identifiers is returned. This list of Ticket Identifiers is then iterated through, requiring a second call to the SOAP based web service using the Ticket Identifier as the key in order to return the required Ticket information.
The OTRS Web service URL is : https://tts.geant.net/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnector
** If you have Admin access to OTRS, you can review the SOAP Based Service settings using the following URL: https://tts.geant.net/otrs/index.pl?Action=AdminGenericInterfaceWebservice;Subaction=Change;WebserviceID=1;Nav=
Two of the available web service operations are used TicketSearch and TicketGet
The SOAP message that is sent to the OTRS web service looks like the following XML:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.otrs.org/TicketConnector/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns:TicketSearch>
<ns:UserLogin>msruser</ns:UserLogin>
<ns:Password>********</ns:Password>
<ns:Types>Maintenance::Planned</ns:Types>
<ns:Types>Maintenance::Emergency</ns:Types>
<ns:Limit>2500</ns:Limit>
<ns:TicketChangeTimeNewerMinutes>60</ns:TicketChangeTimeNewerMinutes>
</ns:TicketSearch>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
*** The TicketChangeTimeNewerMinutes value is set by the parameter sent to the Java Class
***** Password Stored In KeyPass
A typical response from the above operation is:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<TicketSearchResponse xmlns="http://www.otrs.org/TicketConnector/">
<TicketID>204001</TicketID>
<TicketID>203998</TicketID>
<TicketID>203994</TicketID>
<TicketID>203970</TicketID>
</TicketSearchResponse>
</soap:Body>
</soap:Envelope>
The SOAP message that is sent to the OTRS web service looks like the following XML:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.otrs.org/TicketConnector/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns:TicketGet>
<ns:UserLogin>msruser</ns:UserLogin>
<ns:Password>********</ns:Password>
<ns:TicketID>98016</ns:TicketID>
<ns:DynamicFields>1</ns:DynamicFields>
</ns:TicketGet>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
98016 is an example TicketId used as the key to retrieve the Ticket where the TicketID field matches 98016
A typical response from the above operation:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<TicketGetResponse xmlns="http://www.otrs.org/TicketConnector/">
<Ticket>
<Age>35030226</Age>
<ArchiveFlag>y</ArchiveFlag>
<ChangeBy>1</ChangeBy>
<Changed>2017-03-20 16:18:56</Changed>
<CreateBy>1</CreateBy>
<CreateTimeUnix>1469511635</CreateTimeUnix>
<Created>2016-07-26 05:40:35</Created>
<CustomerID>OTRS-GEANT-NREN</CustomerID>
<CustomerUserID/>
<DynamicField><Name>AdditionalRecipients</Name><Value>6noc@cernet.edu.cn</Value><Value>david.west@geant.org</Value></DynamicField>
<DynamicField><Name>Equipment</Name><Value/></DynamicField>
<DynamicField><Name>EventEndTime</Name><Value/></DynamicField>
<DynamicField><Name>EventStartTime</Name><Value/></DynamicField>
<DynamicField><Name>FirstResponseBreach</Name><Value/></DynamicField>
<DynamicField><Name>GeneralInformation</Name><Value/></DynamicField>
<DynamicField><Name>ITSMCriticality</Name><Value>3 normal</Value></DynamicField>
<DynamicField><Name>ITSMDecisionDate</Name><Value/></DynamicField>
<DynamicField><Name>ITSMDecisionResult</Name><Value/></DynamicField>
<DynamicField><Name>ITSMDueDate</Name><Value/></DynamicField>
<DynamicField><Name>ITSMImpact</Name><Value/></DynamicField>
<DynamicField><Name>ITSMRecoveryStartTime</Name><Value/></DynamicField>
<DynamicField><Name>ITSMRepairStartTime</Name><Value/></DynamicField>
<DynamicField><Name>ITSMReviewRequired</Name><Value/></DynamicField>
<DynamicField><Name>MaintenanceClose</Name><Value>closed successful</Value></DynamicField>
<DynamicField><Name>MaintenanceValidated</Name><Value/></DynamicField>
<DynamicField><Name>NMSAlarmID</Name><Value/></DynamicField>
<DynamicField><Name>OpenedAsP1</Name><Value/></DynamicField>
<DynamicField><Name>ProcessManagementActivityID</Name><Value>0</Value></DynamicField>
<DynamicField><Name>ProcessManagementProcessID</Name><Value>0</Value></DynamicField>
<DynamicField><Name>ProcessSelect</Name><Value/></DynamicField>
<DynamicField><Name>Project</Name><Value>GÉANT</Value></DynamicField>
<DynamicField><Name>ProjectM</Name><Value/></DynamicField>
<DynamicField><Name>ProviderRefNo</Name><Value>GJ-2016-823</Value></DynamicField>
<DynamicField><Name>QCInternal</Name><Value/></DynamicField>
<DynamicField><Name>QCQualityIssue</Name><Value/></DynamicField>
<DynamicField><Name>QCSD</Name><Value/></DynamicField>
<DynamicField><Name>QCSupplier</Name><Value/></DynamicField>
<DynamicField><Name>QCVendor</Name><Value/></DynamicField>
<DynamicField><Name>ReportSource</Name><Value>Email</Value></DynamicField>
<DynamicField><Name>SDAccountable</Name><Value>Yes</Value></DynamicField>
<DynamicField><Name>SRCompletionDate</Name><Value/></DynamicField>
<DynamicField><Name>SRFinanceFreeText</Name><Value/></DynamicField>
<DynamicField><Name>SRFinanceInform</Name><Value/></DynamicField>
<DynamicField><Name>SRNewUpgradeDecom</Name><Value/></DynamicField>
<DynamicField><Name>SRNextStage</Name><Value/></DynamicField>
<DynamicField><Name>SROCAcceptance</Name><Value/></DynamicField>
<DynamicField><Name>SRRequestedCapacity</Name><Value/></DynamicField>
<DynamicField><Name>SRRequestedImplementationDate</Name><Value/></DynamicField>
<DynamicField><Name>SRSRFNumber</Name><Value/></DynamicField>
<DynamicField><Name>SubService</Name><Value>UK-TEIN BJ-ORIENTplus</Value></DynamicField>
<DynamicField><Name>Supplier</Name><Value>China Unicom</Value></DynamicField>
<DynamicField><Name>SupportLevel</Name><Value>Tier 1</Value></DynamicField>
<DynamicField><Name>TicketCalendarEndTime</Name><Value>2016-07-31 22:00:00</Value></DynamicField>
<DynamicField><Name>TicketCalendarStartTime</Name><Value>2016-07-31 16:00:00</Value></DynamicField>
<DynamicField><Name>TicketFreeText1</Name><Value/></DynamicField>
<DynamicField><Name>TicketFreeText2</Name><Value/></DynamicField>
<DynamicField><Name>UpdateTimeBreach</Name><Value/></DynamicField>
<DynamicField><Name>allowEmailUpdate</Name><Value>1</Value></DynamicField>
<DynamicField><Name>custID</Name><Value/></DynamicField>
<DynamicField><Name>custIDs</Name><Value/></DynamicField>
<DynamicField><Name>eex1424Circuit</Name><Value/></DynamicField>
<DynamicField><Name>eex1425Circuit</Name><Value/></DynamicField>
<DynamicField><Name>eex1426Circuit</Name><Value/></DynamicField>
<DynamicField><Name>eexAMS100G</Name><Value/></DynamicField>
<DynamicField><Name>eexAMSOOB</Name><Value/></DynamicField>
<DynamicField><Name>eexGEN100G</Name><Value/></DynamicField>
<DynamicField><Name>eexGEN272OOB</Name><Value/></DynamicField>
<DynamicField><Name>eexGEN513OOB</Name><Value/></DynamicField>
<DynamicField><Name>eexLON100G</Name><Value/></DynamicField>
<DynamicField><Name>eexLONOOB</Name><Value/></DynamicField>
<DynamicField><Name>eexOPEN100G</Name><Value/></DynamicField>
<DynamicField><Name>esnetEEX</Name><Value>No</Value></DynamicField>
<DynamicField><Name>geantServiceTypes</Name><Value/></DynamicField>
<DynamicField><Name>highestSLA</Name><Value/></DynamicField>
<DynamicField><Name>internalAlert</Name><Value/></DynamicField>
<DynamicField><Name>internalAlertNotification</Name><Value/></DynamicField>
<DynamicField><Name>secCategory</Name><Value/></DynamicField>
<DynamicField><Name>secFlowmonID</Name><Value/></DynamicField>
<DynamicField><Name>secFlowsSample</Name><Value/></DynamicField>
<DynamicField><Name>secPerspective</Name><Value/></DynamicField>
<DynamicField><Name>secPorts</Name><Value/></DynamicField>
<DynamicField><Name>secProtocol</Name><Value/></DynamicField>
<DynamicField><Name>secSeverity</Name><Value/></DynamicField>
<DynamicField><Name>secSourceIP</Name><Value/></DynamicField>
<DynamicField><Name>secTargetIPs</Name><Value/></DynamicField>
<DynamicField><Name>secTime</Name><Value/></DynamicField>
<DynamicField><Name>secType</Name><Value/></DynamicField>
<DynamicField><Name>ticketReasonCode</Name><Value/></DynamicField>
<EscalationResponseTime>0</EscalationResponseTime>
<EscalationSolutionTime>0</EscalationSolutionTime>
<EscalationTime>0</EscalationTime>
<EscalationUpdateTime>0</EscalationUpdateTime>
<GroupID>14</GroupID>
<Lock>unlock</Lock>
<LockID>1</LockID>
<Owner>samuel.price@intercity.technology</Owner>
<OwnerID>90</OwnerID>
<Priority>3 normal</Priority>
<PriorityID>3</PriorityID>
<Queue>Maintenance</Queue>
<QueueID>22</QueueID>
<RealTillTimeNotUsed>0</RealTillTimeNotUsed>
<Responsible>root@localhost</Responsible>
<ResponsibleID>1</ResponsibleID>
<SLAID/>
<Service>Trunk / Infrastructure</Service>
<ServiceID>25</ServiceID>
<State>closed successful</State>
<StateID>2</StateID>
<StateType>closed</StateType>
<TicketID>98016</TicketID>
<TicketNumber>2016072634000159</TicketNumber>
<Title>[lon] PM, UK-TEIN BJ-ORIENTplus, ChinaUnicom</Title>
<Type>Maintenance::Planned</Type>
<TypeID>6</TypeID>
<UnlockTimeout>1470004353</UnlockTimeout>
<UntilTime>0</UntilTime>
</Ticket>
</TicketGetResponse>
</soap:Body>
</soap:Envelope>
The net.dante.otrs.OTRSProducer JAVA class connects to the test-esb01.geant.net ActiveMQ Message Broker, using credentials stored in the otrs.properties file.
*** It is possible to review the contents of the ESB queue called OTRS using the following URL: http://test-esb01.geant.net:8161/admin/browse.jsp?JMSDestination=OTRS
The XML returned from the OTRS Web Service TicketGet operation is sent as a plain text message to the ESB and stored in the OTRS queue.