diff --git a/include/class.upgrader.php b/include/class.upgrader.php
index 66f69866c2838388de866f476e9f5607846c42c6..b71a3ff6bc4c121c52acef36ed2bc4a229e0c7b0 100644
--- a/include/class.upgrader.php
+++ b/include/class.upgrader.php
@@ -77,6 +77,8 @@ class Upgrader {
     }
 
     function createUpgradedTicket() {
+        global $cfg;
+
         //Create a ticket to make the system warm and happy.
         $dept_id = $cfg->getDefaultDeptId();
         $prio_id = $cfg->getDefaultPriorityId();