One of the features we are missing in SCSM 2010, is ability to see the upcoming changes on a calendar. However, there is a relatively easy way to add it. Microsoft SharePoint is the excellent product family having ability to show the different kinds of events on the calendars. In this blog post I’ll show a small command line tool which takes a Work Item from Service Manager and publishes it to a Sharepoint Calendar through a console task. I called that tool “PublishWI”.

Notes

There are different products in the Microsoft SharePoint family. I developed this tool by using the latest version of SharePoint, Microsoft Sharepoint 2010 Foundation, and tested it with Microsoft Sharepoint Server 2010 too. SharePoint Foundation is provided for free to the customers of Microsoft Windows Server. You can download it from the Microsoft Download site. PublishWI uses two DLLs from Sharepoint 2010, please see the instructions below about where to take them from and how to install them.

I didn’t test this tool with the previous versions of sharepoint, Windows Sharepoint Services 3.0, SharePoint Server 2007 or with any other earlier versions. I don’t have any idea about whether the managed client library from Sharepoint 2010 can be used with WSS 3.0 /SPS 2007. Please try it yourself and let me know :-)

My goal was to provide a working prototype for a web-based calendar for SCSM. I am going to gradually extend this tool in the nearest future. It’s published under Microsoft Open License, so if you are interested in participating in the community-based development activities of this tool, feel free to join the project on CodePlex. There are other interesting SCSM project there, so just pick one (or more than one) you are interested in :-)

Where to take it from

You can download the PublishWI.exe file and the full PublishWI Visual Studio 2010 solution written in C# from the “PublishWI” project at Codeplex.com site. I am more a “rarely programming sysadmin” aka program manager than a professional programmer, so use this tool at your own risk, don’t expect professional code quality (especially in errors/exceptions processing) and and feel free to improve it if necessary.

Users gude

Open a form in SCSM for the Work Item you want to publish to a calendar

In this example I will use a Change Request form

Make sure that Scheduled Start and Scheduled End fields contain the right Date/Time values

If you modified the Scheduled Start/End date and time, save the changes by clicking “Save” button on the form

Click “Publish to calendar” task

Wait for console task to complete:

Refresh the SharePoint Calendar and see the Change Request event on the Calendar:

Open the event:

Behind the scene, the PublishWI tool took the Change Request CR2, created the event on SharePoint Calendar for the dates taken from the Change Request, concatenated the CR ID and Title and copied the result to the event’s title field. Then it copied the Change Description into event Description field.

If PublishWI finds the event on the calendar with the same title, it just updates that event instead of creating the new event with the same title.

This is how the calendar looks like with multiple CRs and Manual Activities published there:

As you can see, it works with the Change Request titles in non-English languages too (with Russian in this case).

There are many ways to extend and modify this tool. You can ask for more properties, change mapping of the fields etc. I do not want to discuss them in this post and will keep it for the future articles. There is also an unlimited number of ways to change the look and feel of the SharePoint calendars by modifying the style sheets, by using Sharepoint Designer or some other tools. You can easily find them on the Internet.

Paste them into the folder with the PublishWI.exe file (or register them on the client computer through regsvr, gacutil etc).

Configure a new console task in SCSM

Select the "Work Item" class as the target class for this task

Select the object where this task will be visible. I would imaging that you will want to use it at least with Change Requests. You can also add a Manual Activities folder if you want to publish information about Manual Activities.

Provide the full path to the PublishWI.exe

Add WorkItem->WorkItem->ID property to the parameters box. Add the URL to the SharePoint site and the name of the Calendar List as described below

Command Line Parameters

Usage

PublishWI WiId SharePointURL CalendarListName

Parameters

WiId - Work Item (WI) Identifier. Example: CR123 SharePointURL - URL to the sharepoint site containing the calendar you want to publish WI to, such as http://www.sharepoint.com CalendarName - the name of the calendar list, such as Calendar, "Change Calendar". You can use double quotes if the name of the calendar contains spaces.

This looks great, any way we can set this up so it also populates the assignees Outlook calendar as well?

Mike

2 Mar 2011 4:02 PM

This tool is quite useful, however, I have a couple of questions.

1. Where is "Category" pulled from. Our instance is not populating the category on the calendar.

2. In the next version, will there be more ability to include more information? Specifically, we are wanting to include the "area" field (from a change request), to create calendar views based on this value.

3. Is there a release date for the next version? If not, is there a way that we can edit the PublishWi.exe ourselves to fit our needs?

Thanks,

Mike

Greg

6 Apr 2011 6:55 PM

I agree with the last two posts... This is awesome, but the real need is for "Assigned to" Work Items to get posted to that user's personal outlook calendar. Also, would be great to filter by "Change Area" as well as we have multiple teams. The general IT Change Calendar is great for a wholeistic view of what everyone is doing, but would like to see it get more granular. The current fields that are pulled into Sharepoint are not very filterable (if that is a word :) But if we had "Assigned to" and "Change Area" Pulled into the fields in Sharepoint somewhere, then we can get more granular and set up work items to individual calendars and work team calendars.

Thanks Guys

Jason M. Perretta

13 Apr 2012 8:49 PM

This is pretty sweet. Do we have to create the calendar in Sharepoint, first? Or does SCSM do it automatically when publishing the Work Item/Change to the calendar?

Hi, we are using Publish to SharePoint feature in SCSM as well. We are currently facing an issue with using "Publish to SharePoint" via VPN. It works fine otherwise but via VPN it times out with an error "AddWIToCalendar has stopped working".

Has anyone else had the same issue? Kindly advise?

Thanks

Herb Winhoven

9 Oct 2013 5:41 PM

Is there a way to have CR auto publish to the SharePoint calendar? I want every CR published to the calendar, I don't want to rely on the user to publish it.

Thanks in advance.

Herb Winhoven

27 Oct 2013 5:06 PM

@Herb

Orchestrator did the trick. Keep in mind that you will need to install the SCSM console on the SCORCH server.