Reference field assignment through REST API

Community Alums
Not applicable

Hello all,

I'm looking for some guidance into how to update a reference field such as "assignment_group" through REST API.

Following the steps indicated at Getting Started with REST - ServiceNow Wiki I have been able to create a new incident and properly assign the caller_id to an existing user by using the user's user_name field (labeled as "User ID") . Unfortunately, I haven't been able to update the assignment group field to an existing group. The user I'm using to call the REST API does have rights to write the "assignment group" field.

My request is something like:

sysparm_input_display_value: [tried with both values - true and false]

default headers: Accept + Content Type as application/json

{"short_description":"Test description", "comments":"My incident comments", "caller_id":"test.user", "assignment_group": "Service Desk"}

Any thoughts of what i may be doing wrong?

Thanks in advanced for all your support!!

3 REPLIES 3

siriprudhivi
ServiceNow Employee
ServiceNow Employee

Hi Berny,


There might be business rules that are restricting from setting "assignment group" field to "Service Desk".   Can you try performing the same operation from UI and see if that is true.


Regards,


Siri


gabrielhadmin
Kilo Contributor

Does it work if you put in the sys_id of your assignment group instead of the name?


JennyHu
Tera Guru
Tera Guru

Hi Berny,



Since Assignment Group is a Reference field, you would need to set the Assignment Group field value to the sys_id of Service Desk.



Thanks,
Jenny