{"id":2817,"date":"2012-02-13T20:54:33","date_gmt":"2012-02-13T19:54:33","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=2817"},"modified":"2012-02-17T10:52:17","modified_gmt":"2012-02-17T09:52:17","slug":"integrate-service-manager-and-sharepoint-annoncements-with-a-bit-of-orchestrator-magic","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=2817","title":{"rendered":"Integrate Service Manager and SharePoint announcements with a bit of Orchestrator magic"},"content":{"rendered":"<p>In this post I will show you some ideas how you\u00c2\u00a0can administrate announcements in SharePoint with Service Manager and Orchestrator. The idea is that announcements are owned by Service Manager and you only use the Service Manager console to create, update and delete announcements. Everything around announcements are then synchronized to SharePoint with Orchestrator. In Service Manager 2012 the announcement part is removed from the self-service portal, but there is an announcement webpart in SharePoint that you can use. To add an announcement webpart\u00c2\u00a0to your Service Manager 2012 self-service portal you can<\/p>\n<ol>\n<li>Browse to your Service Manager self-service portal with an administrator account<\/li>\n<li>Click Home to navigate to the root page<\/li>\n<li>\u00c2\u00a0On the Site Actions menu, select edit page<\/li>\n<li>Click the Insert tab and select Web Part<\/li>\n<li>Select Lists and Libraries\/Announcements and click Add<\/li>\n<li>Now, select the Announcements web part and from the List Tools menu select List\/List Settings<\/li>\n<li>On the List Settings page, select Create Column<\/li>\n<li>Name the new column Announcement and click OK to save. We will use this column to store the Service Manager announcement ID, to keep the link between an announcement in Service Manager and and announcement in SharePoint.<\/li>\n<\/ol>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements01.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2820\" title=\"20120127_announcements01\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements01-300x138.jpg\" alt=\"\" width=\"300\" height=\"138\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements01-300x138.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements01.jpg 767w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>The first runbook is monitoring new announcements in Service Manager. When a new announcement is created in the Service Manager console this runbooks is triggered. The runbook first converts the text that Service Manager has in the announcement from rich text format to plain text. During tests I found some issues around publish text in rich text format on the SharePoint site, so now all text gets published as plain text.\u00c2\u00a0The last activity comes from the SharePoint Integration Pack that you can download\u00c2\u00a0from <a href=\"http:\/\/orchestrator.codeplex.com\/releases\/view\/75877\">Codeplex<\/a>. The activity creates a list item in the new announcement webpart.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements03.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2830\" title=\"20120127_announcements03\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements03-300x72.jpg\" alt=\"\" width=\"300\" height=\"72\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements03-300x72.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements03.jpg 394w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements021.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2829\" title=\"20120127_announcements02\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements021-300x229.jpg\" alt=\"\" width=\"300\" height=\"229\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements021-300x229.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements021.jpg 621w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements04.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2831\" title=\"20120127_announcements04\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements04-300x125.jpg\" alt=\"\" width=\"300\" height=\"125\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements04-300x125.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements04.jpg 590w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>As you can see in the pictures we created a announcement in the Service Manager console, the runbook picked it up and created a list item in SharePoint.\u00c2\u00a0The title on the list item in SharePoint \u00c2\u00a0is a mix of the announcement title and priority. Next runbook handle updates. When you update a announcement in Service Manager this runbook writes the changes to SharePoint. We use the column we added in the announcement webpart to keep the link between announcement in Service Manager and list item in SharePoint.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements05.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2834\" title=\"20120127_announcements05\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements05-300x75.jpg\" alt=\"\" width=\"300\" height=\"75\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements05-300x75.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements05.jpg 418w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements061.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2837\" title=\"20120127_announcements06\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements061-300x233.jpg\" alt=\"\" width=\"300\" height=\"233\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements061-300x233.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements061.jpg 616w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements071.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2840\" title=\"20120127_announcements07\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements071-300x128.jpg\" alt=\"\" width=\"300\" height=\"128\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements071-300x128.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements071.jpg 801w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-4.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2857\" title=\"20120213-4\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-4-300x145.jpg\" alt=\"\" width=\"300\" height=\"145\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-4-300x145.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-4.jpg 562w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-5.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2858\" title=\"20120213-5\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-5-300x150.jpg\" alt=\"\" width=\"300\" height=\"150\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-5-300x150.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-5.jpg 598w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-6.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2860\" title=\"20120213-6\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-6-300x152.jpg\" alt=\"\" width=\"300\" height=\"152\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-6-300x152.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-6.jpg 566w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>It get a bit more complicated when looking at how to handle deleted announcements. Many items in Service Manager have a status that we can look at, for example if the status is equals to closed or resolved. Announcement is deleted as soon as we delete them from the console. Orchestrator can monitor for changes on objects and when a object is created. But we cant monitor when a object is deleted with Orchestrator. But, Service Manager can do that. Service Manager can trigger a workflow when a object is deleted. That is how we will do, we will have a internal Service Manager workflow that will run when a announcement is deleted, it will trigger a runbook that will remove the corresponding list item in SharePoint. The Service Manager workflow will actually drop a file in a folder that Orchestrator will pick up. You can build the workflow with Service Manager Authoring Tool. If you want to look at the example I use you can download it here, <a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/SCSMAnnouncements.zip\">SCSMAnnouncements<\/a>\u00c2\u00a0. The picture below show the script that the workflow run. As you can see it writes the announcement ID to a file, the file is named with a GUID and stored in a remote folder on the <a href=\"file:\/\/\\\\FIELD-SCO02\">\\\\FIELD-SCO02<\/a> server.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements08.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2845\" title=\"20120127_announcements08\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements08-300x107.jpg\" alt=\"\" width=\"300\" height=\"107\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements08-300x107.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements08.jpg 680w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Orchestrator will monitor the folder and pick up any file written to the folder. The file includes the announcement ID of the deleted announcement. Orchestrator will find the corresponding list item in the announcement web part in Sharepoint and delete it.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements09.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2846\" title=\"20120127_announcements09\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements09-300x71.jpg\" alt=\"\" width=\"300\" height=\"71\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements09-300x71.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements09.jpg 459w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>I also created one runbook that will start when a new problem is created in Service Manager with priority 5 or lower. It will then create a announcement in Service Manager with information from the problem work item. It will also update the action log of the problem work item with information about the announcement. The other runbooks could then trigger on the announcement and create the announcement in SharePoint. This runbook includes a Run .NET script activity that generates a GUID. The GUID is used as ID for the trouble ticket action log on the problem work item. The runbook also includes a Map Published Data activity, that is because the Service Manager announcement and the problem work item handle priority different.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements10.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2847\" title=\"20120127_announcements10\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements10-300x52.jpg\" alt=\"\" width=\"300\" height=\"52\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements10-300x52.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/01\/20120127_announcements10.jpg 609w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-1.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2853\" title=\"20120213-1\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-1-300x226.jpg\" alt=\"\" width=\"300\" height=\"226\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-1-300x226.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-1.jpg 656w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-2.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2854\" title=\"20120213-2\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-2-300x201.jpg\" alt=\"\" width=\"300\" height=\"201\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-2-300x201.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-2.jpg 604w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-3.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2855\" title=\"20120213-3\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-3-300x201.jpg\" alt=\"\" width=\"300\" height=\"201\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-3-300x201.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2012\/02\/20120213-3.jpg 605w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>These runbooks use a &#8220;RTF to Plain Text&#8221; activity that my friend Patrik Sundqvist have built for the community. You can download the RTF-to-PlainText integration pack <a href=\"http:\/\/blogs.litware.se\/?p=1200\">here<\/a>. Thanks for the help Patrik, as always!<\/p>\n<p>Please note that this is provided \u00e2\u20ac\u0153as is\u00e2\u20ac\u009d with no warranties at all.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post I will show you some ideas how you\u00c2\u00a0can administrate announcements in SharePoint with Service Manager and Orchestrator. The idea is that announcements are owned by Service Manager and you only use the Service Manager console to create, update and delete announcements. Everything around announcements are then synchronized to SharePoint with Orchestrator. In &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=2817\">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":[60,25],"tags":[],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2817"}],"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=2817"}],"version-history":[{"count":28,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2817\/revisions"}],"predecessor-version":[{"id":3460,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2817\/revisions\/3460"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2817"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}