Is there any REST API to create a business rule?

jak2018
Kilo Contributor

My requirement is, whenever an user select ServiceNow integration in my application I will be making a call to a Scripted REST API and from that scripted api I want to create a business rule on the table specified by the user. So that I can receive change notifications on my web hook. 

How can i achieve this?

Thanks in advance.

 

 

1 ACCEPTED SOLUTION

Yifeng Zhang
Mega Expert

a Business Rule(BR) is just a record in sys_script table. so really you are looking at calling the table API on the sys_script table to create a record,

 

 

in the BR record you can specify which table to assign to, so when you calling the table API, just specify the field with the sys_id of your target incident table. same with the scripts for the BR, it just stored in BR.script field I think.

View solution in original post

8 REPLIES 8

All these users and tables belong to different SNOW instances.

I was thinking of injecting a BR in each users instance when they start the server and delete it when they stop it.

Thanks a lot @Yifeng Zhang

@Yifeng Zhang , hope you are still aware of this 🙂 

 

I do not see `sys_script` in table API of serviceNow REST API Explorer. Can you please suggest, if there is other means, recent ?

Rajashekhar She
Kilo Contributor

@Yifeng Zhang , thank you for sharing the information ..

 

hope you are still remember this 🙂  !

 

We have a similar scenario to bootstrap a  Business Rule to serviceNow from a system, with no human interaction possible..

So, tried to follow the suggestion, but I do not see `sys_script` in table API of serviceNow REST API Explorer. Can you please suggest, if there is other means, recent ?