10 Replies Latest reply on Feb 28, 2020 5:16 AM by PAWAN KAUSHIK

    Creation of a problem using the Rest API

    Balamurali Ippili
      Share This:

      Hi All,

       

      I`m trying to create Problem using the REST API and I found there are two forms "PBM:ProblemInterface_Create" and "PBM:Problem Investigation" and I'm not sure which one to use.

      I could able to use "PBM:ProblemInterface_Create" successfully but I'm getting the request id as "00000000101" which is not appended with PBI and when I create a problem investigation from the UI the value is prefixed with PBI.

       

      When Im trying to use "PBM:Problem Investigation" I'm getting The specified Assigned Group structure is invalid or the specified Assigned Group has no Assignees. Use the search function on the Assigned Group field or use the menus on the Support Company, Organization and Group fields to find a valid group. Even though i used the same values that I used while creating from the UI.

       

      I also see there are three types of problems how to distinguish among the available while creating using REST API.I'm new to the BMC remedy tool so got confused with the functionality.

       

      Please point me to some docs that can help me.

       

      Thank you,

      Surender

        • 1. Re: Creation of a problem using the Rest API
          Ganesh Gore

          You should use 'PBM:ProblemInterface_Create' form. There are some OOTB workflows validates data and then only creates record in main form : PBM:Problem Investigation.

          3 of 3 people found this helpful
          • 2. Re: Creation of a problem using the Rest API
            Balamurali Ippili

            Thank you Ganesh for quick reply.

             

            I could successfully PBM:ProblemInterface_create but I'm not able to see the ProblemInvestigation created in the UI. Can you please point me where can I see the records that got created. The URl That I'm seeing after successful creation is http://{host}/api/arsys/v1/entry/PBM:ProblemInterface_Create/000000000000151.

             

             

            Do i need to use any specific fields while using the PBM:ProblemInterface_create so that the OOTB workflow should take care of the problem investigation creation. The following are the fileds that I'm using right now

             

            PBM_CI_FormName,z1D_CI_FormName,Investigation Driver,Status,Last Name,First Name,Assigned Group Pblm mgr,z1D_Action,Company,Description,Impact,Urgency.

             

             

            Note: I'm able to create the problem even without providing the values to any of these fields

             

            • 3. Re: Creation of a problem using the Rest API
              PAWAN KAUSHIK

              Hi,

               

              You have to navigate to "PBM:ProblemInterface_Create" in Remedy application and perform a search by Request ID field, enter this value:- 000000000000151 in Request ID field it will search the record created in this form.

               

              Try to use minimum required fields in order to create a problem ticket. You can maually enter the details from the UI in this form and see if problem ticket is getting created successfully or not. If yes then use the same fields in your API Request Body.

              • 4. Re: Creation of a problem using the Rest API
                Ganesh Gore

                It looks like value you are passing to field ',Assigned Group Pblm mgr' is invalid or you are not passing all other field values.

                It seems you also need to pass 'Support Company Pblm Mgr' AND 'Support Organization Pblm Mgr' along with

                Can you go to the CTM:SupportGroupFuncRoleLookUp form and search with the values provided:

                 

                'FunctionalRole' = "Problem Manager" AND 'Assignment Availability' = "Yes" AND 'Status-SGR' = "Enabled" AND 'Status-SGP' = "Enabled" AND 'Company' = $Support Company Pblm Mgr$ AND 'Support Organization' = $Support Organization Pblm Mgr$

                • 5. Re: Creation of a problem using the Rest API
                  Balamurali Ippili

                  Hi Pawan,

                   

                  Could you please help me how to navigate to the said form. Do you want me to use the Developer studio? I didnot fid this form anywhere in the application.

                  Sorry, This might be a dumb question but I`m not sure of the BMC remedy functionality.

                  Could you also please point me to some Docs/ Quick videos tutorial to get an overview of the tool.

                   

                  Thank you,

                  Surender

                  • 6. Re: Creation of a problem using the Rest API
                    Balamurali Ippili

                    HI Ganesh,

                     

                    I tried creating the problem by using the following mandatory fields that the PBM:ProblemInterface_Create form suggests

                    {

                      "values": {

                    "Status" : "Draft",

                    "Investigation Driver": "High Impact Incident",

                    "Last Name":"Allbrook",

                    "First Name":"Allen",

                    "Assigned Group Pblm Mgr":"Backoffice Support",

                    "Investigation Justification":"",

                    "Company":"Calbro Services",

                    "Description":"Test fields",

                    "z1D_Action":"CREATE",

                    "Impact":"2-Significant/Large",

                    "Urgency":"2-High"

                    }

                    }

                     

                    The rest call is success and returning me this ID but not able to find the problem when I logged into the UI.

                    As you said are there any fields that the OOTB workflow look for to create the problem of type "Problem Investigation"

                     

                    Thank you,

                    Surender

                    1 of 1 people found this helpful
                    • 7. Re: Creation of a problem using the Rest API
                      Ganesh Gore

                      if call is successful then It should have return 'Request ID' (Id: 1)field value. so go to 'PBM:ProblemInterface_Create' form and try to find out that record.

                      You can make another call to get 'actual' problem id i.e 'Problem Investigation ID (Id: 1000000232)'

                      • 8. Re: Creation of a problem using the Rest API
                        Ganesh Gore

                        and if you want Problem ticket number in same call then you need to modify your url something like:

                         

                        {host}/api/arsys/v1/entry/PBM:ProblemInterface_Create?fields=values(Problem Investigation ID)

                         

                        https://docs.bmc.com/docs/ars91/en/entry-formname-609071438.html#id-/entry/{formName}-Createanentry

                        • 9. Re: Creation of a problem using the Rest API
                          Abhijit Shinde

                          HI Surender,

                           

                           

                          Seems in your code two things are missing one is under body section   "z1D_Action":"PROBLEM"  and Under Headers Content-Type set it to application/json, It will work

                           

                          For Problem Investigation -->"z1D_Action":"PROBLEM"

                          For Solution Database --> “z1D_Action” :"SOLUTION"

                          For Known Error--> “z1D_Action” : "KNOWNERROR"

                           

                          In details:

                           

                          Submit problem ticket but will not return ==> http://<midtier_name>:8008/api/arsys/v1/entry/PBM:ProblemInterface_Create

                          To get the PBI number in same call ==> http://<midtier_name>:8008/api/arsys/v1/entry/PBM:ProblemInterface_Create?fields=values(Problem Investigation ID)

                          In Authorization pass the value AR-JWT {{AUTHCODE}} , where AUTHCODE is variable defined.

                          Content-Typeapplication/json

                           

                          e.g:In Body section pass below values :

                          {

                            "values": {

                          "Status" : "Draft",

                          "Investigation Driver": "High Impact Incident",

                          "Last Name":"Allbrook",

                          "First Name":"Allen",

                          "Assigned Group Pblm Mgr":"Backoffice Support",

                          "Investigation Justification":"",

                          "Company":"Calbro Services",

                          "Description":"REST API Test problem creation",

                          "z1D_Action":"PROBLEM",

                          "Impact":"2-Significant/Large",

                          "Urgency":"2-High"

                          }

                          }

                           

                          Best Regards,

                          Abhijit

                          • 10. Re: Creation of a problem using the Rest API
                            PAWAN KAUSHIK

                            Hi, You can login to BMC Remedy application and open up the mid tier object list by putting below url:-

                             

                            http://midtierservername:8080/arsys/forms/arservername/AR System Mid Tier Object List

                            you will be displayed with below page:-

                             

                            Provide the same values as shown in the above image and select the highlighted name from the list and click on "Open Search" button this will navigate you to the actual form and there you can search with the Request ID field as suggested by Ganesh..