Monthly Archives: April 2013

Implementing a simple SharePoint issue tracking system with cc: style notification emails when items are updated

The scenario

This article describes how to setup a SharePoint list so that each item in the list has a column to allow selection of multiple people to be notified initially when the item is created and also every time the item is subsequently updated or edited.

The scenario proposed to me recently went along these lines:

Do you know if there’s a way to add multiple people’s name/email to an item in a Sharepoint List? So maybe we’re tracking issues, and when the issue record is created, we want to tie 5-6 others to the record so they can be involved/aware in the updating of that record and/or the communications related to it…like a cc: list.

Allow me to embellish the requirements and scenario a little so we know the problem at hand…

We have a implemented a simple Helpdesk issue tracking system in SharePoint.

  • The issues themselves are tracked as a single item in a SharePoint list
  • A new list item is created for each issue
  • Issues are primarily generated from an email received by one of the Helpdesk staff
  • Often we want to keep multiple users informed of a particular issue when it is created and as it progresses
  • We want a no code solution

Note: before we jump into the solution, the crux of the article is about achieving the cc: style notifications. I’m not advocating this as a recommended design for a Helpdesk system.

 

The solution

My first thoughts on this one was to simply add a multi-value Person/Group column to the list called “Notification List”, then create a view and set the filter on the view to where “Notification List” is equal to [Me]. Here’s one of many articles on how to use the [Me] filter. This works great and when you go to the view you just see the items where you are in the “Notification List”. I then thought it would be a simple task to create a SharePoint Alert on this list so that whenever someone creates or modifies an item in this list an alert notification email would get sent out. This all works fabulously if there is only ONE person in the “Notification List” column. As soon as you get multiple users in the “Notification List” column, the alerts just do not get triggered. The view filter works fine and shows the correct items when single or multiple names are entered, but it seems alerts play by a different set of rules.

Time for a different approach, enter workflows. Can we achieve a simple (no code) workflow to send the emails out? Sure we can. Here’s how it is done.

First create a custom list called “Issues”

01-create-issues-list

Now add a people & groups column called “Notification List”. Ensure is accepts multiple values and I’m going to just allow people (not groups) to be selected.

02-create-notification-list-people-groups-column

 

While I’m creating columns I’ll create a few more just to make the scenario a little more realistic. I’ve added Description of Problem, Status, and Assigned To columns. Now when I create a new item in SharePoint my new form looks like this:

03-issue-item-form

 

So now to the meat of our problem, how do we get SharePoint to send an email to everyone on the notification list when the item is initially saved, and then every time the item is edited?

We are going to have to create a workflow using SharePoint Designer. So let’s fire up SharePoint Designer and connect to the site that contains our list. Then select “Lists and Libraries” from the left navigation.

04-open-list-in-sharepoint-designer

Open the Issues list and select List Workflow from the ribbon

05-list-workflow-button

Now provide a name and description for the workflow

06-basic-workflow-details

Now add the “Send an Email” action from the Action ribbon button

07-add-action-send-an-email

Now click the Email these users link to define the email message.

  • Click on the address book picker on the To:
  • Select Workflow Lookup for a User…
  • Set Data source to “Current Item”
  • Set Field from source to “Notification List”
  • Set Return field as “Email Addresses, Semicolon delimited”

08-configure-email-to-use-notification-list-and-format

Now you can specify a subject (using the function builder to include the Title of the issue) and the email body, again you can use columns from the issue item and include a hyperlink directly to the item.

09-define-email-content

Return to the workflow information page and set the triggers to automatically start this workflow when an item is created or changed.

11-set-workflow-triggers

All that’s left is it Save and Publish the workflow

10-save-and-publish-workflow

 

The result

We can now create a new item in SharePoint specifying some users on the Notification List.

12-complete-new-item-in-sharepoint

When we save the item, people on the Notification List will automatically receive an email as shown below.

13-email-notification

 

Now for the gold plating

Remember when we set the scenario that most issues are raised by an email being sent to a Helpdesk staff member (yes they can’t just create them in this list themselves!). What we really want is that email message (and any attachments it has) stored on the issue item as an attachment. This would be a bit tedious for someone to save the email as a file and then manually attach to the new SharePoint item. Enter OnePlaceMail (the Express edition is a free add-on to Outlook). Simply install OnePlaceMail on the Helpdesk users machine that has Outlook. You can now ‘bookmark’ the Issue list and it is available (yes the whole SharePoint list with full functionality) directly in Outlook just like it is an Outlook folder.

14-sharepoint-issue-list-in-outlook

 

What is really awesome about this solution is when an email comes in that you need to create a new issue item for, you simply drag and drop the email to the Issues folder in Outlook and OnePlaceMail performs it’s magic and let’s you complete all the columns without leaving Outlook – no need to even open SharePoint in a browser!

15-drag-drop-with-oneplacemail

The item is now created in SharePoint, the email message is stored as an .msg file attachment, all column values are set and notification emails have been sent out. You can even just click on the Issues folder in Outlook (that we dragged dropped the email to) to see it in SharePoint.

16-view-sharepoint-in-outlook-with-oneplacemail

 

Further Reading (in response to comments on this post)

In response to Eugene’s comment here’s how to achieve inserting a URL link to the SharePoint item in the body of the email message that gets sent out by the workflow.

Please be aware that there is a fundamental different between SharePoint lists and SharePoint document libraries in the format (or syntax) of the URL required.

I’ll first go through creating a link to an item in a document library and then to an item in a list.

Insert URL Link to an Item in a SharePoint Document Library

Use the ‘insert hyperlink’ button to create the link in the body of the email

17-sharepoint-designer-workflow-email-action-insert-hyperlink

Provide the user friendly text to display such as ‘Open Item’

18-sharepoint-designer-workflow-provide-user-friendly-link-text

To build the address use the Fx button as we need to use some properties from the item currently the workflow is running on.

Set Data source to Current Item

Set Field from source to Encoded Absolute URL (this gives us the most portable URL that includes the server name and protocol with any special characters encoded which gives the URL the best chance of surviving being sent through email servers and arriving at the other end intact)

19-sharepoint-workflow-lookup-encoded-absolute-url-current-item

The hyperlink should now have an address of [%Current Item:Encoded Absolute URL%]

20-sharepoint-workflow-lookup-url-current-item-address

Click OK and your hyperlink to the item in SharePoint is done

21-sharepoint-workflow-link-to-item-in-email-body

 

Insert URL Link to an Item in a SharePoint List

You would expect the above technique would also work for list items but unfortunately it does not. It leaves you with a pretty useless URL in this format: http://server/site/Lists/listname/1_.000

The URL format that you need to link to a list item is:

http://server/site/lists/listname/DispForm.aspx?ID=xxxx (where xxx is the ID of your list item)

The simplest way to achieve this format is to supply the fixed portion of the URL and pull the ID portion dynamically. Your Hyperlink address would be something like this:

http://server/site/lists/listname/DispForm.aspx?ID=[%ListItem:ID%]

Advertisements

Photos from the Australian SharePoint Conference

cameron-dwyer-oneplacemail-team-sharepoint-conference-auspc-2013

Thanks to everyone who came and visited us at the OnePlaceMail booth. It’s great to hear from our existing customers and how our recent updates have been making your lives easier! A big thank you to all those brave people that came and introduced themselves, I hope we were able to answer your questions and ensure you left the conference with some valuable knowledge and a pathway forward.

See you at the Australian SharePoint Conference (Sydney)

sharepoint-australia-conference-cameron-dwyer-2013-sponsor-exhibitor-oneplacemailThe SharePoint roadshow is about to roll into town. This year ShareThePoint has organised 2 conferences in Australia (Sydney and Melbourne) in addition to the conference in New Zealand. It seems each year the SharePoint community is growing stronger. OnePlaceMail is again a sponsor of these fantastic events and I’m looking forward to the Sydney conference starting next week.

While Microsoft unveiled most of their surprises at the SharePoint conference in Las Vegas late last year, that does not mean this conference is just a rehash of the sessions from Vegas.  Expect to see sessions delivering content with a bit more knowledge and ‘best practice’ than those delivered in Vegas. I like to think of it more as Vegas was ‘hype’ and these conferences will be more of the ‘reality’.

If you are interested in email integration with SharePoint and generally integrating SharePoint better with the desktop then please stop by the OnePlaceMail stand for a chat and live demo of how we can help you.

The OnePlaceMail team have put in a huge effort delivering features on top of the new SharePoint 2013 Site Mailbox architecture and have also published whitepapers and procedures to get you up and running with Site Mailboxes with the minimum of fuss. Come and pick our brains if you are looking at the new Site Mailbox features of SharePoint 2013.

Have a great conference and don’t forget to come by and say hello.

%d bloggers like this: