Condition for workflow transition

I have a Workflow for Application. It works well but i am having issues for email. The email is send to All user with the leave approver role. What i want is email should be send to the leave approver of the department mentioned in leave application and same goes for User with GM role.
A help will be appreciated.

Hi,

There are two ways to do it.

  1. Untick the “Send Email Alert” on workflow and set up a notification for each combination possible in your organization for email alert.

  2. Create a workflow with multiple state for each leave approver and set the condition on each state as follows:

doc.leave_approver == ‘Email Address of Leave Approver’ for this state

Thanks,

Divyesh M.

But in notification case i got stucked for the GM role and HR manager role, emails are send to all users having gm role

Hi,

Try the second option.

I am using the same for the leave approval workflow and it is working fine.

Thanks,

Divyesh

Hi! thank your for reply just wanted to ask can you please share the states you created for these transition rules.

Hi,

Please find the states as below:

Thanks,

Divyesh

Thank You so much for quick reply.
i have a question
Don’t we have to mention Roles Associated with transition rule in states also in Only Allow Edit For.

This works well but i still have more complexity as i Have multiple leave approvers in same Department.

Hi,

In that case you can create more transition rule like HOD01-Finance and HOD02-Finance for two different leave approvers within finance department and use the condition to differentiate same.

Thanks,

Divyesh

okayy let me try.

Hi!
I tried Your Solution it works fine now i have a GM Above Leave Approver of a particular Department and i want my my leave to go GM i also created roles of GM For Different departments i am giving condition as
doc.department == ‘Deparment Of The GM’ but when my leave approver click on approve it shows
Illegal rule doc.department == “Information Technology - RD” . Cannot use “format”

Have this been solved?