How to set 'priority' field on new incident when using REST API

williaml_
Kilo Explorer

We are trying to create an incident using the REST table API. When creating a new incident, we are always getting the priority field returned as blank...an empty string. When we bring up the incident in the UI, the priority is shown as '1 - Critical' which is not what we want. I have played around with passing various values (using '1' for impact, the integer value 1, '1 - High') to the API but nothing seems to work.

I have tried all combinations of the 'sysparm_input_display_value' and 'sysparm_display_value' querystring values with no results. We always get the same result, which is the ticket gets created as intended, but the 'priority' field always comes back as an empty string.

We have read in the docs, and observed in the UI, that the priority should be set based on the values provided in the 'impact' and 'urgency' field, but that does not appear to be happening.

Any advice?

Thanks,

William

12 REPLIES 12

rgm276
Mega Guru

I would check to see if there is a business rule that is forcing the priority to be set for incidents on insert


basic example:


INC-BRule0Capture.JPG


Hey Robert,



I work for William, there is no business rule set as when we change the impact and urgency manually , the priority changes. It does not change only through the api


I am pretty sure that business rules should still run. You could try making a new 'after' business rule to run on incident to re/set the priority, if I interpret what your saying, then it appears that a run onchange rule is running when you change the record and save that set the priority correctly.


Victor Ruiz
Tera Guru

Is your REST call changing your impact and urgency fields?   If it is just remove impact and urgency from your REST call and let the default values take over.