Filters for List View for Different Roles as per the value of Workflow status

Hello Everyone! I hope everything is fine at your side.

I was spending my time with ERPNext Education Domain. I have created new Doctype for managing student applications. The flow of these applications is maintained using the concept FRAPPE Workflows. I have checked and explored the forum for changing the default filters for list view of doctype but unlucky to get the satisfied solution. I am quite new to framework and Python as well.

What I wanted to do?

I have different roles like Student, Instructor, HOD and Dean and different workflow stages like Draft, Submitted to Instructor, Forwarded to HOD, Forwarded to Dean, More Information Needed etc. I want to implement the scenario in which Instructor, HOD and Dean should see only the student applications which are forwarded/submitted to them and not the others applications which are in different stage. When I researched the forum, I got to know that we can apply filters in listview. The topics that I read at the forum shows how to apply global filters for doctype. But I don’t know how to set default filters for each of the role and that to be as per the value of the workflow stage. And moreover some of roles don’t have direct permission to access few workflow stages. The detailed help will be appreciated.

Thank You

I have checked This Post and applied as custom script for student application doctype. I have also cleared the cache and restarted the server again but this filter is not working. The help will be appreciated.

frappe.listview_settings['Student Application'] = {
onload: function(listview) {
	if (!frappe.route_options){ 
		frappe.route_options = {
		    "workflow_state": ["=", "Approved by Dean"]
} };