[Rt-commit] [rtir] 02/02: fix incident child ticket creation

Dustin Graves dustin at bestpractical.com
Fri Apr 29 18:50:40 EDT 2016


This is an automated email from the git hooks/post-receive script.

dustin pushed a commit to branch 3.4/popup-ticket-create
in repository rtir.

commit 5e176f3dfbc3356f94e32ff1c7e2a02fd98ffa0b
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Fri Apr 29 22:44:08 2016 +0000

    fix incident child ticket creation
    
    On an incident, if you click on the Create or Launch links for IRs
    or Investigations, the resulting ticket should be linked to the
    originating Incident. It appears the incident linking is getting lost
    with the new popup.
---
 static/js/rtir.js | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/static/js/rtir.js b/static/js/rtir.js
index e583cd0..7a134d9 100644
--- a/static/js/rtir.js
+++ b/static/js/rtir.js
@@ -7,16 +7,17 @@ jQuery(function() {
         return href.substring(questionMarkIndex+1);
     };
 
-    var showModal = function(lifecycle, lifecycleDesc) {
-        var queryString = getQueryString(this);
+    var showModal = function(lifecycle, lifecycleDesc, triggeringObject) {
+        var queryString = getQueryString(triggeringObject);
+        console.log(queryString);
         jQuery.get(
             RT.Config.WebHomePath + '/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=' + lifecycle + '&LifecycleDesc=' + lifecycleDesc + '&' + queryString,
             function(html) {
                 // If there's only one queue, just create a ticket in it and skip the modal
                 var queues = jQuery(html).find("select[name='Queue'] > option");
                 if (queues.length === 1) {
-                    window.location.href = RT.Config .WebHomePath + '/RTIR/Create.html?Queue=' + queues.first().val();
-                    return;
+                    window.location.href = RT.Config .WebHomePath + '/RTIR/Create.html?Queue=' + queues.first().val() + '&' + queryString;
+                     return;
                 }
 
                 jQuery("<div class='modal'></div>")
@@ -29,22 +30,22 @@ jQuery(function() {
 
     var showReportsModal = function(e) {
         e.preventDefault();
-        showModal('incident_reports', 'report');
+        showModal('incident_reports', 'report', this);
     };
 
     var showInvestigationsModal = function(e) {
         e.preventDefault();
-        showModal('investigations', 'investigation');
+        showModal('investigations', 'investigation', this);
     };
 
     var showBlocksModal = function(e) {
         e.preventDefault();
-        showModal('blocks', 'block');
+        showModal('blocks', 'block', this);
     };
 
     var showIncidentsModal = function(e) {
         e.preventDefault();
-        showModal('incidents', 'incident');
+        showModal('incidents', 'incident', this);
     };
 
     jQuery("#reports-create").click(showReportsModal);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list