Approval Table query ?

sukran
Mega Sage

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

1 ACCEPTED SOLUTION

Sourabh26
Giga Guru

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.

find_real_file.png

 

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

View solution in original post

4 REPLIES 4

Tony Chatfield1
Kilo Patron

Hi, unfortunately your requirements are not clear, perhaps you can review\update?

@Tony Chatfield Modifield , and waiting for your update / solution on the same

Sourabh26
Giga Guru

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.

find_real_file.png

 

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

@Sourabh Appreciated