Many of us would like to know how to interact with Remedy ticketing system using .NET framework. This is fairly easy to accomplish following several steps:
- Login to BMC Developer Network http://developer.bmc.com/communities/index.jspa
- Register accound and download API from this link:
- NOTE: .NET API is backward compatible. So you can use 7.1 with 6.3 server.
- Create folder C:\ARAPI.NET
- Unzip downloaded files to previously created folder
- Create of modify several Environment variables:
- "C:\ARAPI.NET" -> LIB
- "C:\ARAPI.NET" -> PATH
- Add dll into .NET framework
C:\ARAPI.NET>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\regasm "C:\ARAPI.NET\BMC.ARSystem.dll" /codebaseMicrosoft (R) .NET Framework Assembly Registration Utility 1.1.4322.573Copyright (C) Microsoft Corporation 1998-2002. All rights reserved. Types registered successfully
C:\ARAPI.NET>
-
Create ARTCPPORTenvironment variable. Assign value "5920". This variable will be used as default port to connect to Remedy system.
-
Add BMC.ARSystem and BMC.arnettoc to Assembly Cache at .Net Configuration menu
// Create Remedy Ticket
// C#
// Copyright (C) 2008 Paul Grinberg. All Rights Reserved.
//
// Tested under .NET v1.1.4322
using System; using System.Net; using System.IO; using System.Text; using BMC.ARSystem;
namespace Isrcomputing { class CreateRemedyRequest { [STAThread] static void Main(string[] args) {
try { BMC.ARSystem.Server server; server = new BMC.ARSystem.Server(); server.Login("remedyserver01", "myusername", "mypassword"); // Change this to your server, username , password String formName = "HPD:HelpDesk"; BMC.ARSystem.FieldValueList fieldValues = new BMC.ARSystem.FieldValueList(); // Create an entry fieldValues[8] = "C# - Generation II - Ticket that was automatically generated"; fieldValues[240000007] = "Net Trials....\n\rChecking possibilities"; // Category Field fieldValues[200000003] = "Remedy"; // Type field fieldValues[200000004] = "Import"; // Item Field fieldValues[200000005] = "Assets"; // Case Type fieldValues[260000130] = "Incident"; // Status fieldValues[7] = "New"; // Priority fieldValues[260000126] = "Low"; // Login+ fieldValues[240000005] = "myusername"; // Name+ fieldValues[240000001] = "Joe Shmo"; // Agency fieldValues[200000012] = "ISRCOMPUTING"; // Location fieldValues[200000007] = "50 Broadway";
// Department fieldValues[200000006] = "Operations"; //BMC.ARSystem.EntryIdList entryId = server.CreateEntry(formName, fieldValues); string entryId = server.CreateEntry(formName, fieldValues); Console.WriteLine("Created Entry: " + entryId.ToString()); server.Logout(); } catch(Exception e) { Console.WriteLine("ARSystem.Exception caught\n" + e.ToString()); } } } }
"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe" /lib:C:\ARAPI.NET /reference:BMC.ARSystem.dll /define:DEBUG /optimize /out:createremedyticket.exe createremedyticket.cs |