Jump to content

Any hook to show ticket priority default based on department ?


Jbro

Recommended Posts

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. 🙂

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated