{"id":1642,"date":"2010-07-15T15:44:45","date_gmt":"2010-07-15T13:44:45","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=1642"},"modified":"2010-07-15T15:47:39","modified_gmt":"2010-07-15T13:47:39","slug":"merge-two-incidents","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=1642","title":{"rendered":"Merge two incidents"},"content":{"rendered":"<p>I have seen the question at Technet forums a number of times, is it possible to merge to incidents? In this post I have built a idea how to do it. When you run it you input two incident numbers. The first number\u00c2\u00a0 is the incident that you want to keep, and the second number is the incident that you want to close. The script will move all comments from the action log in the first incident to the second, so your comments will be moved to the incident that will be keep open. This solution require smlets that you can download <a href=\"http:\/\/smlets.codeplex.com\/releases\/view\/47542\">here<\/a>.<\/p>\n<p>I made some notes about how it works&#8230;<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/20100715-0181.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-1656  aligncenter\" title=\"20100715 018\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/20100715-0181-300x200.jpg\" alt=\"\" width=\"300\" height=\"200\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/20100715-0181-300x200.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/20100715-0181-1024x682.jpg 1024w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/20100715-0181.jpg 1197w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/20100715-018.jpg\"><\/a><\/p>\n<p>It includes a couple of scripts<\/p>\n<ul>\n<li>MergeInc.vbs, main vbscript<\/li>\n<li>GetComments.ps1, powershell script that export comments from the incident that you want to close. All comments are stored in C:\\temp\\export.txt<\/li>\n<li>UpdateIncident.ps1, powershell script that update the incident that you want to keep. It will be updated with all the old comments, in one large private comment in the action log<\/li>\n<li>CloseIncident.ps1, powershell script that will close the incident that you don&#8217;t want to keep anymore<\/li>\n<\/ul>\n<p>You can run MergeInc.vbs as a task from the console, the same way I do with a script in <a href=\"http:\/\/contoso.se\/blog\/?p=1605\">this<\/a> post. You could of course pick up a incident ID from the console when you run the console. In this example I have two incidents, IR67 and IR69. For some reason IR69 is a double of\u00c2\u00a0 IR67 so we want to move the comments from IR69 to IR67 and close IR69.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/Merge01.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-1648  aligncenter\" title=\"Merge01\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/Merge01-300x227.jpg\" alt=\"\" width=\"300\" height=\"227\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/Merge01-300x227.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/Merge01.jpg 927w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Run the task and input IR69 and IR67.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/Merge02.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-1652  aligncenter\" title=\"Merge02\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/Merge02-300x118.jpg\" alt=\"\" width=\"300\" height=\"118\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/Merge02-300x118.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/Merge02.jpg 474w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Then IR69 is now closed and there is a comment in the action log<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/Merge03.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-1653  aligncenter\" title=\"Merge03\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/Merge03-300x41.jpg\" alt=\"\" width=\"300\" height=\"41\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/Merge03-300x41.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/Merge03.jpg 691w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>and if we look at IR67 the action log is now updated with all the old comments from IR69<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/merge04.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-1654  aligncenter\" title=\"merge04\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/merge04-300x61.jpg\" alt=\"\" width=\"300\" height=\"61\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/merge04-300x61.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/merge04.jpg 717w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>It is not a optimized enterprise ready solution but it works. You can download my scripts here, <a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/07\/Merge.zip\">Merge<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have seen the question at Technet forums a number of times, is it possible to merge to incidents? In this post I have built a idea how to do it. When you run it you input two incident numbers. The first number\u00c2\u00a0 is the incident that you want to keep, and the second number &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=1642\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[25],"tags":[],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1642"}],"collection":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1642"}],"version-history":[{"count":12,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1642\/revisions"}],"predecessor-version":[{"id":1660,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1642\/revisions\/1660"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1642"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}