Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Run business rule for Integration and not for all cases

Community Alums
Not applicable

I have a business rule written on Incident table. I want this to be executed only when you hit via integration (REST API) . I don't want to run this business rule when you create or update record on Incident form directly (User Interface).

I see a Condition box in Advanced tab of the business rule, how can i achieve this functionality.

1 ACCEPTED SOLUTION

sachin312
Tera Expert

Hi karthik,



I am not sure will it work or not, but Try by putting this !gs.getSession().isInteractive() on business rule advance condition.


View solution in original post

5 REPLIES 5

Kostya
Tera Guru

Hi Karthik,



I do not know your integration, but just a possible solution: if you have only one system user account that is writing to incidident via REST, you could probably use "sys_created_by" or "sys_updated_by" in you condition.



Best regards


Hit the Thumb Icon and/or mark as Correct, if my answer was correct. So you help others to see correct responses and I get fame 🙂

Cheers,
Kostya

Community Alums
Not applicable

Thanks for the response Bazanov, my Business rule runs on Before condition. "sys_created_by" or "sys_updated_by" could be anything in my case. I just want this business rule to execute only for integration (Webservices, REST API, SOAP etc..)


Kostya
Tera Guru

And I would create a group and add this REST accounts to this group and than write a condition to check if the user is within the group. It may be extendible for future.


Hit the Thumb Icon and/or mark as Correct, if my answer was correct. So you help others to see correct responses and I get fame 🙂

Cheers,
Kostya

Community Alums
Not applicable

Thanks! I will create a group and i will test it.