Showing posts with label Administration. Show all posts
Showing posts with label Administration. Show all posts

Sep 24, 2015

Modify SharePoint List Alert to Show ID

There is a list in SharePoint, that seems to be quite overlooked. It is, however a pretty ok light weight ticketing system for a project. Yes, I'm talking about the issue list. One advantage the issue list has over a general task list is that it automatically notifies the person if he or she is set as the assignee of the issue. It used to be, that this notification email - alert - contained the issue ID both in the subject and the email body. Not anymore. 

One of my customers uses issue lists for project ticketing and after migrating from an older version of SharePoint they noticed that the emails no longer had this ID in them. It is quite important for them to have the ID easily available. So I set out to modify the alert templates.

There is no specific alert template for issue list. However, there is one for this assigned to notification email. See the MSDN article about alert templates for further reference on all of the different templates. 

In SharePoint 2013 all alert templates are in one XML file located in the C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\XML directory on the SharePoint App server. The file you need is alerttemplates.xml.

As with anything located in the SharePoint root, you should not modify the original template file, but make a copy of it in the same directory and rename it, eg. alerttemplatesIssueId.xml. Then open this copy file for editing (notepad will do, VisualStudio is more colorful ;) ).

It is a long winded file. The AlertTemplate elements wrap each different template. Each has the template type set as value for Name attribute, e.g. Name="SPAlertTemplateType.GenericList".

In order to simply make the Issue ID visible in the notification email for changed "assigned to" value, find the SPAlertTemplateType.AssignedtoNotification template. Find the properties element. Remove ID from the ImmediateNotificationExcludedFields.


This will make the ID visible in the email body of this notification email. If you wish to have the ID visible in any alert a user subscribes to regarding the Issue list, you will need to remove the ID from the exclude fields of the properties in the GenericList template, since issue list does not have one of its own. Note, that all the other templates have two properties, the Immediate and Digest notification exclude  fields.


This was not enough for my customer, since they wanted to have the ID also in the email subject. This can be achieved rather easily by adding the ID field variable to the subject element. The trick, especially with the AssignedToNotification template, is to find the correct place. 

The ID field variable itself is added as a single tag element: <GetVar Name="NewValue#ID" />

The place to add it to, is next to the item name or list name, eg.


In the AssignedToNotification template this is crammed between two switch elements, inside the subject element. In the GenericList template, the subject element is far more simple:


This would already display the ID in the subject, but just to make it a bit more readable, you should add some HTML between the variables, eg.



Now, save your alert template. In order to get SharePoint to use this template, you need to run a little stsadm command. The easiest way is to open the SharePoint Management shell, run as admin, and then run the command:

stsadm -o updatealerttemplates -url http://<sitecollectionUrl> -filename "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\XML\alerttemplatesIssueID.xml"

(Note, copy-paste will probably not work for the command because of the quotation marks)

After running this command, you need to do an iisreset, and that's it. Your templates are ready and in use!


Sep 6, 2012

Highlights of the Settings in SharePoint 2013 Preview

Working my way around in SharePoint 2013 Preview bit by bit, I started by scanning through the settings of a site and site collection. There are some quite nice enhancements, here some examples of my favorite ones:

- Change the look (Site Look and Feel)

It's the former themes. I didn't really like the themes before. As for these, I haven't formed an opinion quite yet. At least there are quite many of them available and they seem more useful than before. At least someof them.

Plus the modification of the selected theme is easier and more userfriendly:


- Design Manager (Site Look and feel, Publishing sites only)

This is a topic for a complete blog post in itself, or several. But I wanted to mention it here anyway. The new way of creating and managind branding and UI assets for sites, packaging them and importing them as well.



- Site Collection Navigation (Site Collection Administration, Publishing portal only)

You  can disable navigation, disable the security trimming, disable the audiences:

- Site / Site collection app permissions (Site Permissions / Site Collection Administration)

You can set permissions for App access.

- Popularity and Search Reports (Site Collection Administration)

A much more organized manner of looking at usage and search reports than in 2010.

- HTML Field Security (Site Collection Administration)

You can restrict or allow usage of specific web services and sites in iFrames.

- Site Closure and Deletion (Site Administration)

You can add policies for site deletion, e.g. archiving, that can then be used when a site is deleted. Also, the site is trimmed from aggregated places.



- A whole lot of new search-related settings