0

I'm a newbie to AR system API. I am trying to create ticket in BMC Remedy via Java as follows.

Ticket ticket = new Ticket();
String result = ticket.CreateTicket();

Here is my Ticket.java class.

package com.bmc.arsys.ticket;

import com.bmc.arsys.api.*;

public class Ticket {

private static ARServerUser server ;
String EntryId = "";

public String CreateTicket() {

    server = new ARServerUser();
    server.setServer("172.26.29.34");
    server.setUser("dashboards");
    server.setPassword("dashboards");
    server.setPort(1531);

    try {
        System.out.println("start to verify user: ");
        server.verifyUser();
    } catch (ARException arException) {
        System.out.println("Connected to AR Server Error occurred: " + arException.getMessage());
        arException.printStackTrace();

    }
    showARSystemDetails();

    Entry newEntry = new Entry();

    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"));
    newEntry.put(1000000164, new Value("xyz"));
    newEntry.put(1000000161, new Value("xyz"));
    newEntry.put(1000000082, new Value("xyz"));
    newEntry.put(1000000056, new Value("xyz"));
    newEntry.put(1000000019, new Value("xyz"));
    newEntry.put(1000000018, new Value("xyz"));
    newEntry.put(1000000001, new Value("xyz"));

    try {
        EntryId = server.createEntry("HPD:Help Desk", newEntry);
        System.out.println("Request ID: " + EntryId);
    } catch (ARException e) {
        e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
    }

    server.logout();
    return EntryId;
}

private static void showARSystemDetails() {
    System.out.println("Connected to AR Server: " + server.getServerInfoStr());
    System.out.println("AR Server version: " + server.getServerVersion() + "\n");
    System.out.println("List all connected users and last accessed time");
    try {
        for (UserInfo user : server.getListUser(Constants.AR_USER_LIST_CURRENT)) {
            System.out.println("   " + user.getUserName() + " - "
                    + user.getLastAccessTime().toDate());
        }
    } catch (ARException e) {
        System.out.println(e.getMessage());
    }
}

}

It successfully connect to the AR Systen API. But it gives following exception.

ERROR (304): Must have Administrative permissions to perform this operation; 
ERROR (306): Value does not fall within the limits specified for the field;        (Pattern - $MENU$) : 1000000001
ERROR (306): Value does not fall within the limits specified for the field;  (Pattern - $MENU$) : 1000000082
ERROR (326): Required field cannot be blank.; 1000000164
at com.bmc.arsys.apitransport.ApiProxyJRpcBase.verifyStatus(Unknown Source)
at com.bmc.arsys.apitransport.ApiProxyJRpcBase.a(Unknown Source)
at com.bmc.arsys.apitransport.ApiProxyJRpcBase.arCall(Unknown Source)
at com.bmc.arsys.api.ProxyJRpc.ARCreateEntry(Unknown Source)
at com.bmc.arsys.api.ARServerUser.createEntry(Unknown Source)
at com.bmc.arsys.ticket.Ticket.CreateTicket(Ticket.java:65)
at com.arapi.action.RequestHandler.setIssue(RequestHandler.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)
at org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:249)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:249)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:139)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:562)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

I would be appreciated if anyone could help me to solve this.

Thank You

PeeHaa
  • 71,436
  • 58
  • 190
  • 262
Rose18
  • 2,892
  • 8
  • 47
  • 98
  • You're passing to all parameters as "xyz" and the error specifically says that two of the fields (1000000001 and 1000000082) cannot accept such value. – Nir Alfasi Feb 28 '15 at 16:47
  • alfasin, thanks for your comment. I followed the answer of http://stackoverflow.com/questions/1074599/create-ticket-in-bmc-remedy-via-java. If those fields cannot accept such values then what type of values can be accepted for those fields? – Rose18 Feb 28 '15 at 16:59
  • I never worked with "BMC Remedy". You have 4 errors, 3 of them regarding invalid fields values and one about permissions. Go to the documentation and see what is the range of valid values to each one of these fields. Search the documentation for permission-settings as well. – Nir Alfasi Feb 28 '15 at 17:05

2 Answers2

3

ERROR (304): Must have Administrative permissions to perform this operation; >assign the user the administrative group in the user form.

Your User form entry for the dashboards user must be a member of the adminstrator's group and have a fixed license to remove this error..

ERROR (306): Value does not fall within the limits specified for the field; (Pattern - $MENU$) : 1000000001

ERROR (306): Value does not fall within the limits specified for the field; (Pattern - $MENU$) : 1000000082

For these two, the $menu$ pattern indicates that there is a menu defining the values for the fields - make sure that the value you are giving actually meets the requirements. if you are unsure - look up the form in developer studio

ERROR (326): Required field cannot be blank.; 1000000164 you are not submitting a value for this required field.

on a different note, you are submitting directly to HPD:Help Desk. Don't! Use HPD:Incident Interface Create see https://www.scribd.com/doc/2551868/24/Incident-Management-integration page 92 (pdf warning)

Community
  • 1
  • 1
JoSSte
  • 2,953
  • 6
  • 34
  • 54
  • 1
    Great advice. Also, there will probably be several more errors once these are sorted out because of the invalid entries for product and operational categorizations, assigned group, corp id, etc. These should all be valid entries from your Remedy system – csewell Jul 15 '15 at 18:50
-2

you error:

ERROR (304): Must have Administrative permissions to perform this operation; assign the user the administrative group in the user form.

ERROR (306): Value does not fall within the limits specified for the field; (Pattern - $MENU$) : 1000000001 in this field 1000000001 exist menu attach and the value is not in the menu result

ERROR (306): Value does not fall within the limits specified for the field; (Pattern - $MENU$) : 1000000082 the same in this field

ERROR (326): Required field cannot be blank.; 1000000164

you must put value in this field.

Dimag Kharab
  • 4,439
  • 1
  • 24
  • 45
Ruben
  • 1