Jump to content
Jbro

Any hook to show ticket priority default based on department ?

Recommended Posts

Is it possible? to show different priority based on the department it has been chosen to send tickets?

Share this post


Link to post
Share on other sites

you could have continued to use the original escalation thread rather than creating 3 separate ones... it's distracting!

1 hour ago, Jbro said:

Is it possible? to show different priority based on the department it has been chosen to send tickets?

the answer to that is yes & no... 😀

it's yes in the sense that when you go through step 1 (choosing the ticket department and clicking on the link) and get to step 2 (where you enter the ticket details), you can get the hook to pass the correct default urgency level for that chosen department...

<?php

/**
* Set Default Ticket Priority When Opening Support Ticket
* @author brian!
*/
 
function default_ticket_priority_hook($vars)
{
	$deptid = $vars['deptid'];
	if ($deptid == '1') {
		return array("urgency" => "High");
	}
	elseif ($deptid == '3') {
		return array("urgency" => "High");
	}
	else {
		return array("urgency" => "Low");
	}
}
add_hook("ClientAreaPageSubmitTicket", 1, "default_ticket_priority_hook"); 

or you could use department names if you prefer (though personally I think using the dept ID value would be far more reliable).

<?php

/**
* Set Default Ticket Priority When Opening Support Ticket
* @author brian!
*/
 
function default_ticket_priority_hook($vars)
{
	$deptid = $vars['department'];
	if ($deptid == 'Technical Support') {
		return array("urgency" => "High");
	}
	elseif ($deptid == 'Billing') {
		return array("urgency" => "High");
	}
	else {
		return array("urgency" => "Low");
	}
}
add_hook("ClientAreaPageSubmitTicket", 1, "default_ticket_priority_hook"); 

where you will come unstuck is if the user changes the department at step 2 (via the dropdown) - at that point, the hook wouldn't trigger again and I suspect your only option would be to edit the template and use a js onchange to trigger the dept dropdown changing the priority dropdown... and I can leave you to figure that out, dear. 🙂

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines