User Tools

Site Tools


resolution_area:prometheus_resolutions:res-p9118

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resolution_area:prometheus_resolutions:res-p9118 [2022/10/19 11:10] 10.91.110.100resolution_area:prometheus_resolutions:res-p9118 [2022/12/23 16:02] (current) 10.91.110.100
Line 11: Line 11:
  
 **Manual Action Steps:** Query to check for grand child tickets. **Manual Action Steps:** Query to check for grand child tickets.
-<code>SELECT+<del><code> SELECT
   pt.id AS child_id,   pt.id AS child_id,
   pt.parent_id AS parent_id,   pt.parent_id AS parent_id,
Line 17: Line 17:
   gc.parent_id AS  grand_child_parent_id   gc.parent_id AS  grand_child_parent_id
 FROM FROM
-  ticket pt +  ticketer.ticket pt 
-JOIN ticket gc ON+JOIN ticketer.ticket gc ON
   gc.parent_id = pt.id   gc.parent_id = pt.id
 WHERE WHERE
-  pt.parent_id IS NOT NULL;</code>+  pt.parent_id IS NOT NULL; 
 +</code>
      
 From the query above take the child_id value and set the parent_id to null From the query above take the child_id value and set the parent_id to null
-<code>update ticketer.ticket set parent_id = NULL where id = <child_id>;</code> +<code>update ticketer.ticket set parent_id = NULL where id = <child_id>;</code></del>
  
 +Just execute the below query:
 +<code>
 +update ticketer.ticket set parent_id = NULL where id in (select * from (SELECT
 +  pt.id AS child_id
 +FROM
 +  ticketer.ticket pt
 +JOIN ticketer.ticket gc ON
 +  gc.parent_id = pt.id
 +WHERE
 +  pt.parent_id IS NOT NULL) a);
 +</code>
  
 **Auto Clear:** Will clear when there are no grand child tickets on system. **Auto Clear:** Will clear when there are no grand child tickets on system.
resolution_area/prometheus_resolutions/res-p9118.1666174236.txt.gz · Last modified: 2022/10/19 11:10 by 10.91.110.100