Menu

REST create ticket with service and service subcategories included

2023-04-27
2023-07-04
  • Samuel Chan

    Samuel Chan - 2023-04-27

    Hi, i was in progress to create an extension for auto assign ticket, and I had been using REST to create ticket, was wondering if there is a chance that I can include service_id and servicesubcategory_id in core/create? so that it can help to auto assign ticket? thank you

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2023-04-27

    Yes, you can set those values during creation. Just add those fields in your core/create file and point to the right IDs.

     
  • Samuel Chan

    Samuel Chan - 2023-04-27

    how can I ensure I have the right ID? I tried to look into ticket_request to get some of the IDs to check, but every time when I use Postman to test create ticket, it will be invalid object... do I need to have anything wrap the service_id and servicesubcategory_id?

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2023-04-27

    You could just check in iTop. When viewing the details of for example a service, you'll see "id=" in the URL.

     
  • Samuel Chan

    Samuel Chan - 2023-04-27

    so I have double check I have service_id 10, and it has servicesubcategory_id 1, but I still have the below error

    Here's the code I use in Postman

    {{rest_endpoint}}?version={{rest_version}}&json_data={
       "operation": "core/create",
       "comment": "Synchronization from blah...",
       "class": "UserRequest",
       "output_fields": "id, friendlyname",
       "fields":
       {
          "org_id": "SELECT Organization WHERE name = \"LYNK\"",
          "caller_id":
          {
             "name": "Chan",
             "first_name": "Samuel"
          },
          "title": "Laptop issue",
          "description": "My laptop is not responding",
          "service_id": "10",
          "servicesubcategory_id": "1"
       }
    }
    
     
  • Guillaume Lajarige

    Are you sure that you are pointing to the right URL? You seem to be using Postman, maybe you have the wrong env. variable in {{rest_endpoint}}

     
  • Samuel Chan

    Samuel Chan - 2023-04-27

    the URL part is right, as if I removed service_id and servicesubcategory_id, I can create ticket with no issue, that {{rest_endpoint}} is just a variable setting in Postman

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2023-04-27

    Another thing which comes to mind: the REST user is not restricted to certain organizations? (Doubt this is the issue, but worth checking)

     

    Last edit: Jeffrey Bostoen 2023-04-27
  • Samuel Chan

    Samuel Chan - 2023-04-27

    Currently we only have 1 organizations in place, so this is not an issue yet...

     
  • Pierre Goiffon

    Pierre Goiffon - 2023-07-04

    Can you try to create a userRequest manually with the same data ?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.