3

I need a Java class to submit tickets to BMC Remedy's Helpdesk product.

Wondering if anyone has done this already and is willing to share either code, or experience.

PeeHaa
  • 71,436
  • 58
  • 190
  • 262
geoffc
  • 4,030
  • 7
  • 44
  • 51

1 Answers1

8

Geoff,
Have a look below. This will create a bare bones ticket in the HPD:Help Desk form of v7. Hope this helps.

-Jason


/* This creates an entry in the form HPD:Help Desk, returns the Entry ID (not Incident Number) to the command line */

import com.bmc.arsys.api.*;

public class CreateEntry {

public static void main(String[] args) {

//Initialize a new ARServerUser object, this is the main object we are using for all actions

// for e.g. user=Demo, password=pwd, server=remedy, port=7100

ARServerUser context = new ARServerUser("Demo", "pwd", "", "","remedy",7100);

//A new entry we want to submit into remedy

Entry newEntry = new Entry();

//put the field values in there. (Integer fieldID, Value of field)

newEntry.put(7, new Value(0));          // Status<br>
newEntry.put(8, new Value("This record is created via Java API"));  // Short Description<br>
newEntry.put(1000000163, new Value(4000));  // Impact - (High) 1000/2000/3000/4000 (Low)<br>
newEntry.put(1000000162, new Value(4000));  // Urgency - (High) 1000/2000/3000/4000 (Low)<br>
newEntry.put(1000000000, new Value("xyz")); // Description<br>
newEntry.put(1000000151, new Value("xyz")); // Details<br>
newEntry.put(1000000099, new Value(0));     // Service Type - 0/1/2/3<br>
newEntry.put(240001002, new Value("xyz"));  // Product Name<br>
newEntry.put(200000003, new Value("xyz"));  // Product Cat Tier 1<br>
newEntry.put(240001002, new Value("xyz"));  // Product Cat Tier 2<br>
newEntry.put(200000005, new Value("xyz"));  // Product Cat Tier 3<br>
newEntry.put(1000000063, new Value("xyz")); // Operational Cat Tier 1<br>
newEntry.put(1000000064, new Value("xyz")); // Operational Cat Tier 2<br>
newEntry.put(1000000217, new Value("xyz")); // Assigned Group<br>
newEntry.put(1000000054, new Value("xyz")); // Corporate ID<br>
newEntry.put(2, new Value("Demo"));<br>

try{

//And here we create the entry itself, printing out the EntryID we get back

String EntryId = context.createEntry("HPD:Help Desk", newEntry);

System.out.println("Request ID = "+EntryId);

}

catch(ARException arException){

arException.printStackTrace();

}

}

}
Andrew T Finnell
  • 13,417
  • 3
  • 33
  • 49
  • I know you do not have enough points to comment in response yet, (though maybe you do now) but what is the JAR that contains the classes com.bmc.arsys.api.* – geoffc Jul 02 '09 at 19:04
  • Assuming api version 7.0, both arapi70.jar and arutil70.jar need to be on the classpath. If not version 7.0, adjust file names accordingly. Could be 75, 63, or 60, doubt you're dealing with anything older than that. Both can be found in the ARSystem server base directory. –  Jul 02 '09 at 19:58
  • 1
    Just noticed a bug above. Change

    newEntry.put(240001002, new Value("xyz")); // Product Cat Tier 2 to

    newEntry.put(240001004, new Value("xyz")); // Product Cat Tier 2
    –  Jul 02 '09 at 20:20
  • I see comments don't like html here :) Just need to change the FID for Product Cat 2 to 240001004. –  Jul 02 '09 at 20:22
  • Can you edit the change back in? You can always edit your own answer or question. You need 2000 points (I think) to edit someone elses... As for the JAR's, perfect! I would be using this in a Novell Identity Manager driver instance, and we need those specific JAR's to get the driver working in the first place. Thanks for all your help! – geoffc Jul 09 '09 at 16:13
  • I would suggest creating the tichet thorugh the HPD:IncidentInterface_Create form instead – JoSSte Jun 01 '17 at 12:31