Filtering for User List

I have created a link field and linked it to User. What I want is it will not show complete user list but only selected role i have created. How to do filtering for that link field type. I tried in depends on condition but that didn’t worked

You can set query filters in that DocType’s js file.

cur_frm.set_query('<user_fieldname>', function(doc) {
	return {
		query: "path.to.query",  // only if you want to handle it server-side
		filters: {
			// enter filters here
		}
	};
});

don’t have access to server side

And this is what I’m trying

frappe.ui.form.on("FASTRACK", "onload", function(frm) {
    cur_frm.set_query("test_user_name", function() {
        return {
           "filters": {
                "roles": "Analyst",
            }
        }
    });
});

but this isn’t working.
I am not getting the exact field from user list where role is assigned

EDIT : Any way to direct filtering without frappe.call ?

For future reference, the field is called “role_profile_name” instead of “roles” in User doctype in v13