Naming Conventions - OfficeDev/microsoft-teams-apps-requestateam GitHub Wiki
Introduction
Request-a-team now includes the ability to define Naming Conventions/Policies for created Teams.
Naming conventions can be configured at the following levels:
- Global - All requests will adhere to this naming convention including those created from a template.
- Template - Define naming conventions specific to each template that you create/configure in the 'Teams Templates' list.
- Template & Global - Requests created 'From blank' will use the 'Global' configured convention and where defined, Templates will use their own naming convention.
There is no UI in the Power App to configure this yet (this is being worked on) so naming conventions must be set up in the SharePoint site for now.
Note - If no templates have naming conventions configured and naming conventions have been enabled, the templates will use the Global configuration.
What does this look like?
Teams:
When a team is created using a naming convention, it will appear as follows:
-
In the example above 'TM_' is the configured prefix.
-
The middle part is the Team Name that the user specifies when making a request, in this example 'Service Desk'.
-
The last part (the suffix) is using an attribute. In this example it is the users' department (IT).
-
Prefix and suffix text (in addition to attributes) is also being used to separate the team name with underscores. This is configurable so dashes etc. could be used. Any spaces in the Prefix or Suffix should be automatically removed.
SharePoint:
The backing SharePoint site Name and URL will follow that of the naming convention:
The SharePoint site URL will have any spaces in the 'Team Name' removed.
Azure AD:
The group name and email address in Azure AD will match the specified naming convention. The group name will retain spaces but the email will have these automatically removed.
Configuration
To enable this new functionality, the value of the 'UseNamingConventions setting in the 'Team Request Settings' list MUST be set to 'true'. By default this will be set to 'false' after deployment.
Global naming convention
Before creating any Template naming conventions, it is important to set a global naming convention.
Both a Prefix and/or Suffix can be set which will be prepended and appended to the Team Name entered by the user when requesting a team.
To set a global naming convention, follow the steps below:
- Navigate to the 'Team Request Settings' list in the SharePoint site.
- Edit the 'NamingConvention' list item and specify the following values (these are examples and can be replaced with your own):
- Value - Leave blank
- PrefixText - Set to 'TM_' (or any text you wish to use for the prefix).
- PrefixAttribute - Leave blank OR select an attribute (from the users' profile) to use. In this example leave blank.
- PrefixUseAttribute - Set to 'Yes' IF you selected an attribute OR set to False if you did not define an attribute. For this example set it to 'No'.
- SuffixText - Set to '_' for this example (or any text you wish to use for the suffix).
- SuffixAttribute - Leave blank OR select an attribute (from the users' profile) to use. In this example set it to 'Department' (The users' department).
- SuffixUseAttribute - Set to 'Yes' IF you selected an attribute OR set to False if you did not define an attribute. For this example set it to 'Yes'.
For all other fields please DO NOT edit the values.
Note - If you use PrefixText AND a PrefixAttribute OR SuffixText AND a SuffixAttribute. The text will be appended onto the end of the attribute value. This is so that you can separate the attributes/text from the Team Name e.g. 'HR'._
A global naming convention has now been configured. When a team is requested, it should look something like:
TM_Team Name_UsersDepartment e.g. TM_My Awesome Team_HR
Please now test the naming convention by creating a new request 'From scratch'.
Template naming convention
Template naming conventions allow you to set specific naming conventions for templates (or types of teams). If templates have naming conventions defined these will override the global one.
For more details on how to create templates for use with Request-a-team, please follow the documentation - Teams Templates.
For this example, we will apply a naming convention to one of the Microsoft out of the box templates but you can define your own templates as per the documentation above and configure naming conventions against these.
This functionality works in a similar way to the global naming convention so should be easy to follow:
To set a template naming convention, follow the steps below:
- Navigate to the 'Teams Templates' list in the SharePoint site.
- Edit one of the list items, in this case we will choose 'Manage a Project'.
- Configure the values as follows -
- Prefix Text - Set to 'PRJ_' (or any text you wish to use for the prefix).
- Prefix Attribute - Leave blank OR select an attribute (from the users' profile) to use. In this example leave blank.
- Prefix Use Attribute - Set to 'Yes' IF you selected an attribute OR set to False if you did not define an attribute. For this example set it to 'No'.
- SuffixText - Set to '_' for this example (or any text you wish to use for the suffix).
- Suffix Attribute - Leave blank OR select an attribute (from the users' profile) to use. In this example set it to 'Department' (The users' department).
- Suffix Use Attribute - Set to 'Yes' IF you selected an attribute OR set to False if you did not define an attribute. For this example set it to 'Yes'.
- Save the list item.