1 2 Previous Next 25 Replies Latest reply on Sep 13, 2016 10:47 AM by LJ LongWing

    How to access Incidents & Work order information from Remedy AR System 8.0 Using Java API.

      Share This:

      Hello All,

       

      I am new to Remedy AR System.

       

      Can you please guide me how to access Incidents & Work order information from Remedy AR System 8.0 Using Java API.

       

      import com.bmc.arsys.api.*;

      import java.util.*;

      public class Apps

      {

        private ARServerUser server;

        private String formName= "HPD:Help Desk";

        public Apps()

        {

       

        server = new ARServerUser();

         }

        server.setServer("Server name");

        server.setPort(port);

        server.setUser("username");

        server.setPassword("password);

        }

      using this code i can able to connect  AR Server.but not able to figure it out which form incidents & Work orders are present .

       

      My main intention is to pull the incidents & work orders information from Remedy AR System.

       

      Can you please help me for the same...

       

      Many Thanks,

      Savitha

        • 3. Re: How to access Incidents & Work order information from Remedy AR System 8.0 Using Java API.

          Thanks Carl for the answer actually we are using the Remedy AR System 8.1 is there any methods to retrieve all the forms in AR System using Java API.

          • 4. Re: How to access Incidents & Work order information from Remedy AR System 8.0 Using Java API.
            Ganesh Gore

            You can try getForm method :

             

            public Form getForm(String formName, FormCriteria criteria) throws ARException

            • 5. Re: How to access Incidents & Work order information from Remedy AR System 8.0 Using Java API.

              Thank you very much Ganesh, Carl & Jarl

               

               

              Can you please help me I am getting the error in Java API program when I am trying to search

               

              test.queryEntrysByQual("(\'Assigned Group' = \"DC Level2 Support\")");

               

              Display only fields cannot be included in a query to the database
              HPD:Incident Management Console : <1000000217>
              ERROR (286): Display only fields cannot be included in a query to the database; HPD:Incident Management Console : <1000000217>

               

              Method Details

              *************************

              void queryEntrysByQual(String qualStr)
              {
                List list;
                System.out.println();
                System.out.println ("Retrieving entryies with qualification " +qualStr);
                try
                {
                 // Retrieve the detail info of all fields from the form.
                
                 List <Field> fields =server.getListFieldObjects(formName);
                 System.out.println("My Fields------------>"+fields);
                 // Create the search qualifier.
                 QualifierInfo qual = server.parseQualification(qualStr,fields, null, Constants.AR_QUALCONTEXT_DEFAULT);
                 System.out.println ("QualifierInfo"+ qual);
                
                  int[] fieldIds = {2, 7, 8};
                 OutputInteger nMatches = new OutputInteger();
                 List<SortInfo> sortOrder = new ArrayList<SortInfo>();
                 sortOrder.add(new SortInfo(2,Constants.AR_SORT_DESCENDING));
                 // Retrieve entries from the form using the given
                 // qualification.
                 List<Entry> entryList = server.getListEntryObjects(formName, qual, 0,Constants.AR_NO_MAX_LIST_RETRIEVE,sortOrder, fieldIds, true, nMatches);
                 System.out.println ("Query returned " + nMatches +" matches.");
                 if( nMatches.intValue() > 0)
                 {
                  // Print out the matches.
                  System.out.println("Request Id " +"Short Description" );
                  for( int i = 0; i < entryList.size(); i++ )
                  {
                    System.out.println(entryList.get(i).getEntryId() +" " +entryList.get(i).get(Constants.AR_CORE_SUBMITTER)+" "+entryList.get(i).get(Constants.AR_CORE_STATUS));
                  }
                 }
              }
              catch( ARException e )
              {
                 ARExceptionHandler(e,"Problem while querying by qualifier. ");
              }
              }

              • 6. Re: How to access Incidents & Work order information from Remedy AR System 8.0 Using Java API.
                Jarl Groneng

                You have to query against the HPD:Help Desk form, not the Incident Console.

                • 7. Re: How to access Incidents & Work order information from Remedy AR System 8.0 Using Java API.
                  Ganesh Gore

                  HPD:Incident Management Console is itself a DISPLAY only form. You can not perform search operation on this form. To get data, You should query HPD:Help Desk form or join form 'HPD:CFG_IncidentWatchList'.

                  • 8. Re: How to access Incidents & Work order information from Remedy AR System 8.0 Using Java API.

                    Thank a lot Ganesh & Jarl for your valuable time

                     

                    Actually i need to display my group incidents information like incident ID,Priority,Status & Assignee.

                    & my Assigned Group is DC Support 

                     

                    can you please suggest me how to query the AR System to get the data from different forms(join form)

                     

                    below code shows the some incidents information but its not belong to my group.

                     

                    private String formName= "HPD:CFG_IncidentWatchList";

                     

                    test.queryEntrysByQual("(\'Assigned Group' = \"DC Support\")");
                    test.queryEntrysByQual("(\'Assignee' = \"Abhilash\")");

                     

                    void queryEntrysByQual(String qualStr)
                    {
                      List list;
                      System.out.println();
                      System.out.println ("Retrieving entryies with qualification " +qualStr);
                      try
                      {
                       // Retrieve the detail info of all fields from the form.
                      
                       List <Field> fields =server.getListFieldObjects(formName);
                       System.out.println("My Fields------------>"+fields);
                       // Create the search qualifier.
                       QualifierInfo qual = server.parseQualification(qualStr,fields, null, Constants.AR_QUALCONTEXT_DEFAULT);
                       System.out.println ("QualifierInfo"+ qual);
                       //List<Entry> entryList =
                        int[] fieldIds = {2, 7, 8};
                       OutputInteger nMatches = new OutputInteger();
                       List<SortInfo> sortOrder = new ArrayList<SortInfo>();
                       sortOrder.add(new SortInfo(2,Constants.AR_SORT_DESCENDING));
                       // Retrieve entries from the form using the given
                       // qualification.
                       List<Entry> entryList = server.getListEntryObjects(formName, qual, 0,Constants.AR_NO_MAX_LIST_RETRIEVE,sortOrder, fieldIds, true, nMatches);
                       System.out.println ("Query returned " + nMatches +" matches.");
                       if( nMatches.intValue() > 0)
                       {
                        // Print out the matches.
                        System.out.println("Request Id " +"Short Description" );
                        for( int i = 0; i < entryList.size(); i++ )
                        {
                          System.out.println(entryList.get(i).getEntryId() +" " +entryList.get(i).get(Constants.AR_CORE_SUBMITTER)+" "+entryList.get(i).get(Constants.AR_CORE_STATUS));
                        }
                       }
                    }
                    catch( ARException e )
                    {
                       ARExceptionHandler(e,"Problem while querying by qualifier. ");
                    }
                    }

                     

                    is there any documentation how to get the data from Remedy AR System.?

                    • 9. Re: How to access Incidents & Work order information from Remedy AR System 8.0 Using Java API.
                      Carl Wilson

                      Hi,

                      actually you should not use the HPD:Help Desk form directly, you should use the supplied interface form "HPD:IncidentInterface" for all queries and modifications. 

                      Over the versions, BMC changed the way the forms worked and some of the functions do not work correctly when going direct to the application form.

                      As each application has an associated "xxx_Create" and "xxxInterface" form, these should be used.

                       

                      Cheers

                      Carl

                      • 10. Re: How to access Incidents & Work order information from Remedy AR System 8.0 Using Java API.
                        Carl Wilson

                        Hi,

                        you would query the interface form "HPD:IncidentInterface" using a qualification for your Support Group.

                        The issue with the code you pasted is that you have double defined a qualification, yet have not provided the correct variable "qualStr" into the query code being executed:

                         

                        private String formName= "HPD:CFG_IncidentWatchList";

                         

                        test.queryEntrysByQual("(\'Assigned Group' = \"DC Support\")");
                        test.queryEntrysByQual("(\'Assignee' = \"Abhilash\")");

                         

                        void queryEntrysByQual(String qualStr)
                        {
                          List list;
                          System.out.println();
                          System.out.println ("Retrieving entryies with qualification " +qualStr);
                          try
                          {
                          // Retrieve the detail info of all fields from the form.
                         
                          List <Field> fields =server.getListFieldObjects(formName);
                          System.out.println("My Fields------------>"+fields);
                          // Create the search qualifier.
                          QualifierInfo qual = server.parseQualification(qualStr,fields, null, Constants.AR_QUALCONTEXT_DEFAULT);
                          System.out.println ("QualifierInfo"+ qual);
                          //List<Entry> entryList =
                            int[] fieldIds = {2, 7, 8};
                          OutputInteger nMatches = new OutputInteger();
                          List<SortInfo> sortOrder = new ArrayList<SortInfo>();
                          sortOrder.add(new SortInfo(2,Constants.AR_SORT_DESCENDING));
                          // Retrieve entries from the form using the given
                          // qualification.
                          List<Entry> entryList = server.getListEntryObjects(formName, qual, 0,Constants.AR_NO_MAX_LIST_RETRIEVE,sortOrder, fieldIds, true, nMatches);
                          System.out.println ("Query returned " + nMatches +" matches.");
                          if( nMatches.intValue() > 0)
                          {
                            // Print out the matches.
                            System.out.println("Request Id " +"Short Description" );
                            for( int i = 0; i < entryList.size(); i++ )
                            {
                              System.out.println(entryList.get(i).getEntryId() +" " +entryList.get(i).get(Constants.AR_CORE_SUBMITTER)+" "+entryList.get(i).get(Constants.AR_CORE_STATUS));
                            }
                          }
                        }
                        catch( ARException e )
                        {
                          ARExceptionHandler(e,"Problem while querying by qualifier. ");
                        }
                        }

                         

                         

                        So, using the BMC Example as a base (I am not going to write it all out, but point out the key things - you need to place the definitions for the form and qualification in the appropriate parts of your code ....):

                         

                        // Define form name.

                        private String formName= "HPD:IncidentInterface";

                         

                        // Retrieve entries from the form using the given qualification. With

                        // the returned entry set, print out the ID of each entry and the

                        // contents in its short Description field.

                         

                        qualStr = "";

                         

                        // Define the Search String

                        qualStr = "\'Assigned Group\' = " + "\"DC Support\"";

                         

                                void queryEntrysByQual(String qualStr) {

                                    System.out.println();

                                    System.out.println ("Retrieving entries with qualification " +

                                        qualStr);

                                    try {

                                         // Retrieve the detail info of all fields from the form.

                                        List <Field> fields = server.getListFieldObjects(formName);

                                       

                                        // Create the search qualifier to be passed into the "getListEntryObjects" call using the defined search criteria above.

                                        QualifierInfo qual = server.parseQualification(qualStr,

                                                             fields, null, Constants.AR_QUALCONTEXT_DEFAULT);

                         

                                        // Define the list of fields returned by the "getListEntryObjects" call [add all fields required to this statement].

                                        int[] fieldIds = {2, 7, 8};

                         

                                       // Define the integer that holds the number of records returned by the "getListEntryObjects" call

                                        OutputInteger nMatches = new OutputInteger();

                         

                                        //Create the sort order for the returned results

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

                                        sortOrder.add(new SortInfo(2, Constants.AR_SORT_DESCENDING));

                                       

                                        // Retrieve entries from the form using the given

                                        // qualification.

                         

                                        List<Entry> entryList = server.getListEntryObjects(formName, qual, 0, Constants.AR_NO_MAX_LIST_RETRIEVE, sortOrder, fieldIds, true, nMatches);

                         

                                        System.out.println ("Query returned " + nMatches + " matches.");

                                      

                                        //  Print out the values returned for each entry

                                        if( nMatches.intValue() > 0){

                                             // Print out the matches.

                                             System.out.println("Request Id" + "Short Description" );

                                             for( int i = 0; i < entryList.size(); i++ ){

                                                  System.out.println(entryList.get(i).getEntryId() + " " + entryList.get(i).get(Constants.AR_CORE_SHORT_DESCRIPTION));

                                                  }

                                         }

                         

                                    } catch( ARException e ) {

                                             ARExceptionHandler(e, "Problem while querying by qualifier. ");

                                    }

                                }

                         

                         

                        Cheers

                        Carl

                        • 11. Re: How to access Incidents & Work order information from Remedy AR System 8.0 Using Java API.

                          Hi Carl,

                           

                          Actually i am not calling double defined a qualification i need the incidents list based on any one of these qualification.

                          but i am getting the incident list but those incidents are not under the DC Support group even though i mentioned group in the qualification.

                           

                          please see the code here

                           

                          private String formName= "HPD:IncidentInterface";

                          qualStr = "\'Assigned Group\' = " + "\"DC Support\"";

                          test.queryEntrysByQual(qualStr);

                           

                          one more question what are the constant i need to used when i want to retrive "Request Type","Status","Priority","Assigned Group","Assignee"

                          like

                          entryList.get(i).get(Constants.AR_CORE_STATUS_HISTORY)

                           

                          Please suggeste me for the same.

                           

                           

                          Thank you

                          • 12. Re: How to access Incidents & Work order information from Remedy AR System 8.0 Using Java API.

                            Hi Ganesh, Carl & Jarl,

                             

                            I am Java developer its first time I am working in Remedy AR System integration.

                             

                            My requirement is to design the dashboard integrate with Remedy AR System(Incident Management console) to get my team incidents information.

                             

                            Can you please suggest , I want to learn Remedy AR System integration(using Java API & Soap Web Services) is there any online training so that I can learn..?

                             

                            Many Thanks

                            Savitha

                            • 13. Re: How to access Incidents & Work order information from Remedy AR System 8.0 Using Java API.
                              Ganesh Gore

                              You will get required information from 'HPD:IncidentInterface' form as suggested by Carl. It is self join of HPD:Help Desk form.

                              Please check below sample code.

                              // Retrieve entries from the form using the given qualification.

                              Java API sample code for managing BMC Remedy AR System records - BMC Remedy Action Request System 8.1 - BMC Documentatio…

                              • 14. Re: How to access Incidents & Work order information from Remedy AR System 8.0 Using Java API.

                                Hi Ganesh,

                                 

                                I am trying with the same example but still i am not getting correct incidents of my team.

                                 

                                i am getting the incident list but those incidents are not under the DC Support group even though i mentioned group in the qualification. & i was tried with different forms.

                                 

                                please see the code here

                                 

                                private String formName= " HPD:Help Desk";

                                qualStr = "\'Assigned Group\' = " + "\"DC Support\"";

                                test.queryEntrysByQual(qualStr);

                                 

                                one more question what are the constant i need to used when i want to retrive "Request Type","Status","Priority","Assigned Group","Assignee"

                                like

                                entryList.get(i).get(Constants.AR_CORE_STATUS_HISTORY)

                                 

                                Please suggeste me for the same.

                                 

                                 

                                Thank you

                                1 2 Previous Next