How Can we Restrict Ticket By Team In Helpdesk

Hello,

how can we mange ticket by team.

first when anyone create a ticket its show only one support team and this team can assign ticket to other releted team.

and if i have two team sales and technical and support.
when new ticket raised by user its only show to support team and support team read this and pass to releted team like sales or technical and if assign to technical then sales team will not able to see this ticket.

i try to restrict ticket by using user role permission and restrict ticket by team check box in HD Setting.
image

how can i map this flow in frappe helpdesk

Did you get it working ??

No, i done after writing my custom code

@pithiya_Nilesh can you share your approach and how you achieved it? I’d love to see any code examples or the stages you went through.

I also try with this option, also do some debugging.

From my understanding, I believe the function get_list_filters from HDTicket class which is the only place that lookup the Restrict tickets by Team.

However, from my testing, there is now where this fuction is called. And the method get_list_filters itself is created more than a year ago. I come to believe this feature is lost in development.

I open an issue to the team. HD Settings > Restrict tickets by Team option, is not working · Issue #2022 · frappe/helpdesk · GitHub

As temp solution, to ensure that for HD Ticket with HD Team (agent group) assigned, only HD Team member will see it. We use Server Script type Permission Query as below,

# Find HD Teams for session user
user_teams = []
teams = frappe.get_all("HD Team", pluck='name')
for team in teams:
    users = []
    t = frappe.get_doc("HD Team", team)
    for u in t.users:
        users.append(u.user)
    if frappe.session.user in users:
        user_teams.append(team)
user_teams = user_teams and str(user_teams).replace('[', '(').replace(']', ')') or "('')"
conditions = "(agent_group in %s or agent_group is null)" % user_teams

1 Like