How to get mandatory approvals from two people in a workflow and until the two of them approve, it should be 'Requested' and once both of them approve then only it should be 'No longer required'.

utkarsha_s
Kilo Expert

Hi Guys,

Let me know how to get mandatory approvals from two people in a workflow and until the two of them approve, it should be 'Requested' and once both of them approve then only it should be 'No longer required'. If the first person has approved, still it should be in Requested state until one more person approves and then no longer required.

How do I achieve this from a workflow ?

Thanks,

Utkarsha Saxena

1 ACCEPTED SOLUTION

Hi,


Try following code in approval activity of your workflow.



find_real_file.png




Raj


View solution in original post

26 REPLIES 26


5.png


utkarsha_s
Kilo Expert

Hi Supriya,



Doesn't 'everyone to approve' mean all the people in the group approval activity have to approve ? I want something like if any two people from a group approves and these two could be any two from that list, then for the rest of the people the approval state should be 'No longer required'.



Will this solution work for my need ?



Thanks,


Utkarsha


Please check if this helps.



var gr = new GlideRecord('sysapproval_approver');


gr.addQuery('sysapproval', current.sys_id);


gr.addQuery('state', 'approved');


gr.query();


if(gr.getRowCount() == '2')


        return 'yes';


else


      return 'no';


Hi Shishir,



Could you please tell me where to write this code ? And if anything apart from this code as well has to be written ?



Thanks,


Utkarsha Saxena