0

我是 AR 系统 API 的新手。我正在尝试通过 Java 在 BMC Remedy 中创建票证,如下所示。

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

这是我的 Ticket.java 类。

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());
    }
}

}

它成功连接到 AR Systen API。但它给出了以下例外。

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)

如果有人可以帮助我解决这个问题,我将不胜感激。

谢谢你

4

2 回答 2

3

错误(304):必须具有管理权限才能执行此操作;>在用户表单中为用户分配管理组。

您的仪表板用户的用户表单条目必须是管理员组的成员并且具有固定许可证才能删除此错误。

错误 (306):值不在为字段指定的范围内;(模式 - $MENU$):1000000001

错误 (306):值不在为字段指定的范围内;(模式 - $MENU$):1000000082

对于这两个,$menu$模式表明有一个定义字段值的菜单 - 确保您提供的值实际上符合要求。如果您不确定 - 在开发人员工作室中查找表格

错误(326):必填字段不能为空。1000000164 您没有提交此必填字段的值。

另一方面,您直接提交给HPD:Help Desk。不!使用HPD:Incident Interface Create请参阅https://www.scribd.com/doc/2551868/24/Incident-Management-integration第 92 页(pdf 警告)

于 2015-07-15T13:27:36.347 回答
-2

你的错误:

错误(304):必须具有管理权限才能执行此操作;在用户表单中为用户分配管理组。

错误 (306):值不在为字段指定的范围内;(Pattern - $MENU$) : 1000000001 in this field 1000000001 存在菜单附加并且该值不在菜单结果中

错误 (306):值不在为字段指定的范围内;(模式 - $MENU$) : 1000000082 在这个字段中相同

错误(326):必填字段不能为空。1000000164

您必须在此字段中输入值。

于 2015-06-09T01:31:28.480 回答