3 Replies Latest reply on Sep 5, 2016 1:51 AM by Aries Kou

    Problem in setting HPD_CI field of Incident Ticket using HPD:IncidentInterface

      Share:|

      Hi,

      I am using AR java API 7.5 to create and modify incident ticket.

      I have used form "HPD:IncidentInterface_Create" to create the Incident Ticket, then I am using "HPD:IncidentInterface" form to modify it programitically.

      I am able to modify some fields (for example "Detail Description"), but when I try to set the Field "CI+" (field id: 303497400, field Name; HPD_CI) of the created Incident Ticket, I get following exception:

      ERROR (45670): ; Please select a CI from the menu provided or search for a CI by pressing the CI search button.

       

      I am able to modify the same Incident Ticket using Remedy User, it allows me to select a CI like a Computer System, but i am not able to set the CI field programatically. Following is the code I have used.

       

      ARServerUser user = new ARServerUser();

      user.setServer("ARServerName");

      user.setUser("Demo");

      user.setPassword("");

      String formNameIncidentInterfaceCreate = "HPD:IncidentInterface_Create";

      String formNameIncidentInterface = "HPD:IncidentInterface";

      // start creating entry.
      Entry entry = new Entry();

      entry.put(1000000076, new Value("CREATE")); // z1D_Action

      entry.put(1000000018, new Value("Mishra")); // Last Nam

      entry.put(1000000019, new Value("Deepak")); // First Name

      entry.put(7, new Value("New")); // Status

      entry.put(1000000099, new Value("Infrastructure Event")); // Service Type

      entry.put(1000000163, new Value("4-Minor/Localized")); // Impact

      entry.put(1000000162, new Value("4-Low")); // Urgency

      entry.put(1000000000, new Value("Sample description for solidcore ticket.")); // Description

      entry.put(1000000215, new Value("BMC Impact Manager Event")); // Reported Source

      String entryId = user.createEntry(formNameIncidentInterfaceCreate, entry);

      System.out.println("IncidentTicket EntryId: " + entryId);

      // Creation of entry complete.

      // Get Incident Number

      int[] fieldIds = new int[]{1000000161}; // Field Id for Incident Number
      Entry entryCreated = user.getEntry(formNameIncidentInterfaceCreate, entryId, fieldIds);

       

      Value value = entryCreated.get(1000000161);

      String incidentNumber = (String)value.getValue();

      System.out.println("Incident Number = " + incidentNumber);
       

      // Get the EntryId for form "HPD:IncidentInterface"
      List<Field> fieldList = user.getListFieldObjects(formNameIncidentInterface);

      QualifierInfo qualifier = user.parseQualification("'Incident Number' = \"" + incidentNumber + "\"", fieldList, null,Constants.AR_QUALCONTEXT_DEFAULT);

      List<SortInfo> sortInfos = new ArrayList<SortInfo>();

      OutputInteger in = new OutputInteger();

      List<Entry> entries = user.getListEntryObjects(formNameIncidentInterface, qualifier, 0, Constants.AR_NO_MAX_LIST_RETRIEVE, sortInfos, null, true, in);

      System.out.println("Entry id for form " + formNameIncidentInterface +" = " + entries.get(0).getEntryId());

      String entryidForIncidentInterface = entries.get(0).getEntryId();

       

      // Update the incident using form "HPD:IncidentInterface"
      Entry entryToModify = new Entry();

      entryToModify.put(1000000076, new Value("MODIFY")); // z1D_Action

      entryToModify.put(1000000161, new Value(incidentNumber)); // Incident Number

      entryToModify.put(1000000001, new Value("Calbro Services")); // Company

      entryToModify.put(1000000163, new Value("4-Minor/Localized")); // Impact

      entryToModify.put(1000000162, new Value("4-Low")); // Urgency

      entryToModify.put(1000000000, new Value("Sample description for solidcore ticket.")); // Description

      entryToModify.put(1000000151, new Value("Detail description")); // Detail Description

      entryToModify.put(7, new Value("Assigned")); // Status

      entryToModify.put(1000000099, new Value("Infrastructure Event")); // Service Type

      entryToModify.put(1000000215, new Value("BMC Impact Manager Event")); // Reported Source

      entryToModify.put(303497400, new Value("ComputerSystemCI")); // HPD_CI field This field is creating problem.

      user.setEntry(formNameIncidentInterface, entryidForIncidentInterface, entryToModify, null, 1);

      user.logout();

       

      Please help me in setting HPD_CI field of Incident

        • 1. Problem in setting HPD_CI field of Incident Ticket using HPD:IncidentInterface

          Hi,

           

          This error usualy crops up when $Menu$ pattren match set for the field which is throwing this error. please do check few things like

           

          1. what value is getting passed to HPD_CI field if this is the CI name then check if there are mistakes in the value passed to it

          2. is the database case sensitive or not.

           

          you can remove the pattren mach on the fieldl to get away with this error but this will lead to data inconsistancy.

           

          Br,

           

          Prashanth

          • 2. Problem in setting HPD_CI field of Incident Ticket using HPD:IncidentInterface

            Hi Prashant,

            The error message is comming because of a filter "HPD:INC:ValidateCI_085_E". It throws an error 45650 with error message "Please select a CI from the menu provided or search for a CI by pressing the CI search button." when following condition is met.

             

            (('HPD_CI' != 'DB.HPD_CI') AND ('HPD_CI' != $NULL$)) AND ('HPD_CI_ReconID' = $NULL$)

             

            I do not understand the meaning of DB.HPD_CI, but I observed that when I set HPD_CI using "Remedy User",

            The value of HPD_CI_ReconID (field ID 303522900) is populated with a value something like "OI_2A3634EC4E26439A88E87BEED0E52F51".

             

            I also observed that when same CI is set to some other Incident, same value of HPD_CI_ReconID is set in both of the Incident ticket.

             

            Other thing that was observed that, when HPD_CI field is set for an Incident, an entry is created for form "HPD:Associations"; this form has a field "Request ID01", it has the same value that I find for HPD_CI_ReconID in "HPD:Help Desk" form. The form "HPD:Association" has fiew more fields like "Form Name01" whose value gets set to "AST:ComputerSystem" and a field "Request ID02" whose values is set as "Incident Number" of the incident.

             

            Please help me find out, how the value of "Request ID01" is set in "HPD:Associations", this must be related to some fields of entry in "AST:ComputerSystem"

            • 3. Re: Problem in setting HPD_CI field of Incident Ticket using HPD:IncidentInterface
              Aries Kou

              is this issue resolved, can we have an update ? thanks