Stop a Business Rule from executing

thisisauniqueus
Giga Expert

Hi,

I have a setup where i am receiving REST request from 3rd party, i have used scripted REST API, and in response to incoming request i create/update a Demand ticket. So far so good. For send back updates i have created an update BR and using REST Message to send the updates back to 3rd party.

The problem is when the 3rd party sends an update request the BR is also triggered which should only be triggering when the updates are made in my instance. I have tried using

gr.setWorkFlow(false);

in the script to update the ticket from 3rd party, but that stops the additional comments and all the journal input fields to be updated, because i guess the journal fields are populated using a BR too. So my question is how can i make the BR to fire only when the update is made directly from the form NOT from the scripted REST API script?

Any help in this regards is appreciated. Kindly let me know if you need any additional information.

Regards,

JS

20 REPLIES 20

After some testing, (e.g. setting short_description instead of comments) I believe it is because comments is a journal field and gets updated in a completely different table (sys_journal_entry). When you use setWorkflow(false), it stops that entry in another table happening (because it is triggered by a business rule and you just shut those off.)


yup i tested that one too, is there any other way than using gs.IsInteractive(); i dont know if "Run Business Rules" functionality, in Transform Maps is internal to SN, but that exactly applies to my use case.



Regards


None that I'm aware. I'm out of ideas at this point. Unless someone else has something... I recommend reaching out to customer support. I'll be interested to hear what they have to say.


HI Service Portal - ServiceNow


Contact Support | ServiceNow


Thank you so much for you time


Hi ctomasi



I stumbled upon your post "Consumerize" Data Imports to Non-ServiceNow Administrators



i see a helper class



find_real_file.png



Can you please tell me that if "GlideImportSetTransformerWorker" has an onComplete method?



Regards