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

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

  • Comments 12
  • Likes

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.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Hi Vladimir.

    This looks really cool, keep up the good work. :-)

    Cheers

    Anders

  • Great Stuff, this is exactly what customers are asking us about....

    rgds,

    Klaus

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

  • 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

  • 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

  • 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?  

    -Jason

  • @Jason -

    You need to create the calendar first.  Part of the configuration of this solution requires that you provide the name of the calendar.

  • Hi ! Did somebody try that on 2012 as well ?

  • Hey Guys,

    This is indeed great work.

    For your information, Cireson has created a Change Schedule Calendar that works directly within Service Manager. www.cireson.com/.../scsm-change-calendar

    Feel free to contact me.

    Paul.

  • 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

  • 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

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