How to send approvals based on conditions

Nani18
Tera Contributor

Hello Experts,

Example : I have created 13 fields in catalog item 

field 1 is  Select CI (reference to cmdb_ci table)

2,3,4,5,6,7,8,9,10,11,12,13 created fields same as cmdb_ci form (name,install status,assignment group ....etc)

Created catalog client script to auto populate remaining fields (2 to 13) if user selected in Field 1

please refer the attached screenshot 

Nani18_0-1706116204345.png

 

In 1st if activity : I am comparing selected CI form 3 fields value and current.varaibles 3 fileds value . If 3 fields is not same as catalog 3 variables then it will trigger an approval 

In 2nd activity  and 3rd activity also i am comparing same as above 

 

Example :

1. If user updated 2nd,3rd,4th fields on catalog form then approval need to go A user.

2. If user updated 5th,6,7th fields on the catalog form then approval need to go B user

3.If user updated 8th,9,10th fields on the catalog form then approval need to go C user

4. If user updated 11th,12,13th fields on the catalog form then approval need to go D user

 

Now the problem is 

Scenario 1. 

If user updated 12 fields at a time on the catalog item how to send approvals to A,B,C,D users....?

Scenario 2.

If user updated 5,6,7 fields and 11,12,13 fields then how to send approvals to B,D users....?

 

Thanks in advance 

 

Best regards,

Nani

 

2 REPLIES 2

AshishKM
Kilo Patron
Kilo Patron

Hi @Nani18 , 

You can add if condition and check all 12 fields changes and add all 4 approvers in one go, same is for other case.

It's not clear that these approvals are parallel or sequential.

 

-Thanks,

AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

johansec
Tera Guru

You can check this at the start of the workflow in a script. Then store the approver ids you would like in an array and assign it to a scratchpad variable. 

 

Then you can send them all at once in an approval or can create another scratchpad counter and loop through each one of them and generate an approval until the counter reaches the length of the array of approvers. 

 

Either way I like to use scratchpad vars for dynamic approvals like this .