Business Rule won't run

Community Alums
Not applicable

I need to execute a Business Rule - when a certain catalog item is triggered from a particular Request type, eg., if the short description of the Request starts with "IT onboarding for". 

 

I have setup a business rule to run on Insert of the particular catalog item - and in the business rule itself wrote the below code to check the request's short description: 

 

    var check = new GlideRecord("sc_task");
    check.addEncodedQuery("cat_item=717ab6fd13b7f6042b3fXXXXXXXXX^request.short_descriptionSTARTSWITHIT onboarding request for");
    check.addQuery("sys_id", current.sys_id);
    check.query();

    if (check.next()) { 
	//Confirmed that its linked to "IT Onboarding request"
        //trigger the payload
}

 

But the Business Rule, simply won't run, if I enable the "Update" flag and test by updating the Task - it works, just not on Insert. Please advise!!!

5 REPLIES 5

Hi @Community Alums ,
Oh,,, I got that there is no major difference,,,

How about using Script Debugger to check the step by step running?
If you click "only INSERT" as trigger, and when you set break points on each step in the code, you will be able to check how the script runs including the Rest outbound calling.

Hope you can figure this issue out,,,