Skip to main content
Solved

Creating Service Request via REST API

  • January 17, 2023
  • 6 replies
  • 746 views

I'm studying the api and I realized that whenever I open a new service request it is automatically assigned to me. Is there a way to not attribute it to anyone?

Best answer by willgalvao

Done. All, or at least most, keys for the original object must be sent together. So to change the attribution we use the "responsibility" key.

@abhatia You must make a POST request to /api/v1/sr passing in the header the Content-Type = application/json and JSESSION = value that you retrieve at login.
In the body of the request:

 

{
    "subject": "Service Request Subject",
    "description": "Service Request Description",
    "status": "2",
    "assignedTo": "1",
    "info": [
              {
               "key": "responsibility",
               "value": "4", <--- user ID
               "valueClass": "",
               "mandatory": false,
               "editable": true,
               "type": "list",
               "defaultValue": null,
               "customColumnType": null,
               "keyCaption": "Process manager",
               "valueCaption": ""
               }
             ]
}

 

View original

Forum|alt.badge.img
  • Community Enthusiast
  • January 17, 2023

Please share ypur code as I am trying to create a service request using REST API and I am new to it. Thanks.


  • New SysMate
  • January 17, 2023

Done. All, or at least most, keys for the original object must be sent together. So to change the attribution we use the "responsibility" key.

@abhatia You must make a POST request to /api/v1/sr passing in the header the Content-Type = application/json and JSESSION = value that you retrieve at login.
In the body of the request:

 

{
    "subject": "Service Request Subject",
    "description": "Service Request Description",
    "status": "2",
    "assignedTo": "1",
    "info": [
              {
               "key": "responsibility",
               "value": "4", <--- user ID
               "valueClass": "",
               "mandatory": false,
               "editable": true,
               "type": "list",
               "defaultValue": null,
               "customColumnType": null,
               "keyCaption": "Process manager",
               "valueCaption": ""
               }
             ]
}

 


Maayan Karstaedt
SysAider
Forum|alt.badge.img

@willgalvao amazing stuff, thanks for sharing!

 


  • New SysMate
  • January 18, 2023

I'm still doing tests and understanding better, but it's not necessary to send the entire object as I mentioned before.
I was able to create and change it by passing only key and value.


Is there a way to not assign the sr to anyone (i.e. Process Manager = “none”)?  I tried setting responsibility to null, but it still assigns the sr to the user whose credentials I used to login to the api with.


It is possible to avoid automatically assigning the service record to yourself via API? I would like to create SRs via API which are then managed by routing rules inside the help desk.


Reply


Want Some cookies?

No, literally. We have some. 😉 By continuing browsing on our site you agree to our cookie policy.

 
Cookie settings