Solved

Creating Service Request via REST API

  • 17 January 2023
  • 5 replies
  • 551 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?

icon

Best answer by willgalvao 17 January 2023, 23:53

View original

5 replies

Badge

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

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": ""
}
]
}

 

Userlevel 5
Badge

@willgalvao amazing stuff, thanks for sharing!

 

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.

Reply