- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 10:12 AM
Hi team ,
I want to trigger event from business rule from approval table for specfic condition , how to achieve configuring the condition ?
Sys approval table - when to run condition
1) State is approved ( Here If manager and 2nd level approval are same in RITM request , its get auto approved)
2) Comments contains - > Auto approved , because of manager has been approved
3) Its for specific catalog item ( need to query item name here)
How to do that
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 11:39 PM
Hi,
Below is the logic you can apply.
For the above 2 conditions
1. State is Approved
2. For specific Catalog Item
Note : this is the below query that we used in our BR
state=approved^sysapproval.ref_sc_req_item.cat_item=49f303121baf3450c076fcccdd4bcb44^EQ
you can define these conditions directly in the BR as below.
For other condition
3. Comments contains "Auto Approved" you need to write below script in your BR.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var cmt = current.comments;
if(cmt.indexOf('Auto Approved') == -1){
gs.eventQueue('your_event_name',current,'parm1','parm2'); // Trigger event
}
})(current, previous);
Mark this as Helpful/Correct if this helps you in anyways.
Regards,
Sourabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 12:56 PM
Hi, unfortunately your requirements are not clear, perhaps you can review\update?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 08:11 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 11:39 PM
Hi,
Below is the logic you can apply.
For the above 2 conditions
1. State is Approved
2. For specific Catalog Item
Note : this is the below query that we used in our BR
state=approved^sysapproval.ref_sc_req_item.cat_item=49f303121baf3450c076fcccdd4bcb44^EQ
you can define these conditions directly in the BR as below.
For other condition
3. Comments contains "Auto Approved" you need to write below script in your BR.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var cmt = current.comments;
if(cmt.indexOf('Auto Approved') == -1){
gs.eventQueue('your_event_name',current,'parm1','parm2'); // Trigger event
}
})(current, previous);
Mark this as Helpful/Correct if this helps you in anyways.
Regards,
Sourabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2022 05:34 AM