Change Calendar. Publishing Work Item to … Part 1. Sharepoint Calendar

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

Change Request form

  • Wait for console task to complete:

image

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

image

  • Open the event:

    image

    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:

    image

    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.

    Configuration Steps

    • Create a folder on the computer with SCSM Console
    • Copy PublishWI.exe to that folder
    • Take the following two SharePoint 2010 dlls from your SharePoint Server C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI
      • Microsoft.SharePoint.Client.dll
      • Microsoft.SharePoint.Client.Runtime.dll
    • 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
      • The parameters string should loook like that:
        • $Context/PropertyType=’CustomSystem_WorkItem_Library!System.WorkItem’/Id$ http://itweb Calendar
      • Complete the configuration of the task

    image

    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.

    Examples

    PublishWI CR123 http://itweb Calendar
    Publishes Change Request CR123 to the Calendar list at the http://itweb SharePoint site

    PublishWI CR321 http://businessweb “IT Change Calendar”
    Publishes Change Request CR321 to the “IT Change Calendar” calendar list at the http://businessweb SharePoint site

    Next steps

    These are features we can add to this tool over time:

    • Add Change Manager or Activitiy Implementer from the “Assigned To” field to the event’s participants with notifications, mobile views of SharePoint Calendar etc.
    • Publish WI as a Sharepoint Task
    • Do the same with Meetings and Tasks in Exchange

    I would very appreciate your feedback about this tool and its future extensions.