{"id":10652,"date":"2015-12-10T10:40:00","date_gmt":"2015-12-10T10:40:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2015\/12\/10\/adding-a-custom-field-to-a-work-item\/"},"modified":"2022-08-02T06:35:17","modified_gmt":"2022-08-02T14:35:17","slug":"adding-a-custom-field-to-a-work-item","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/adding-a-custom-field-to-a-work-item\/","title":{"rendered":"Adding a custom field to a work item"},"content":{"rendered":"<div>\n  Thank you everyone for your patience, but the wait is finally over.\u00a0 Today begins our journey delivering process customization to Visual Studio Team Services (VSTS)!\u00a0 We\u2019re releasing the first stage of the rollout plan I described back <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2015\/07\/27\/visual-studio-online-process-customization-update.aspx\">in July<\/a>, the ability to add custom fields &#038; modify layout for existing work item types.\u00a0 Before jumping into the details I want to talk about the goals we have set for ourselves while delivering customization to VSTS. <\/p>\n<ol>\n<li>\n      Processes can be shared across multiple projectsWe\u2019ve seen customers with multiple team projects struggle to keep them all aligned when managing process updates.\u00a0 In VSTS, processes are stored at the collection level and when a process changes, all team projects referencing that process see the change.\u00a0 This is a change from our current model in TFS where the process is stored in each team project.\n    <\/li>\n<li>\n      Updates to the product will work on any processMost customers want to use our \u201cout of the box\u201d processes (Agile, Scrum, CMMI) but want to make a few tweaks to make the process fit well with their organization.\u00a0 In VSTS, you can use our processes as a base and create an inherited process to store your own customizations.\u00a0 As we move our processes forward with updates and enhancements, you can expect to inherit all new changes while preserving your own customizations.\n    <\/li>\n<li>\n      UX built into the productYou shouldn\u2019t need a PHD in TFS to make customizations!\u00a0 We have built experiences into our web portal to allow process administrators to make the changes they want through a simple and approachable UI without having to muck with XML files or additional tools.\n    <\/li>\n<\/ol>\n<\/div>\n<div>\n  With that in mind, let\u2019s see how you can customize your team projects\u2026 <\/p>\n<h2>\n    Shared and inherited process<a name=\"Process\"><\/a>\n  <\/h2>\n<p> As discussed above and in the last <\/p>\n<p>  <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2015\/07\/27\/visual-studio-online-process-customization-update.aspx#SharedInheritedProcess\">2 posts on customization<\/a>, the first change from the existing TFS process customization is moving to a shared process model.\u00a0 Customizations will no longer be scoped to a team project.\u00a0 Rather, process will be its own entity and team projects will reference a process to get the definition of work item types, fields, links, etc.\u00a0 In addition, we will allow a one-level inheritance tree where an inherited process can augment and override the choices made by the process it&#8217;s inheriting from. \u00a0\n<\/div>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>\n        \u00a0<a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/2728.Figure201.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/2728.Figure201.png\" alt=\"\" border=\"0\" \/><\/a>\n      <\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top\">\n        Figure 1. In TFS today, projects make a copy of process templates to define their initial process.\u00a0 The project is then the target of all customizations.\u00a0 In the new world, projects reference a process and the process is the target of all customizations.\n      <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>On the admin site at the collection level, we have a new Process page (figure 3) that allows you to view and interact with all the processes in the collection.<\/p>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>\n        \u00a0<a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/7411.Figure203.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/7411.Figure203.png\" alt=\"\" border=\"0\" \/><\/a>\n      <\/td>\n<\/tr>\n<tr>\n<td>\n        Figure 2. Process overview admin site.\u00a0 Custom Agile is the default process used when creating new projects.\u00a0 Agile and CMMI are disabled so new projects cannot be created using these processes.\n      <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>You can easily create new team projects from the context menu.\u00a0 When creating a project, a user can only use processes which are enabled\u2026 so if you want to enforce that all new projects are \u201cCustom Agile\u201d, just disable the rest!\u00a0 You can also drill into a process to view and modify the types, fields, etc. that are defined inside the process.\u00a0 Over time we\u2019ll be adding more customizations but right now you can modify the fields on work item types.\u00a0 But before you can do that, you need to create an inherited process.<\/p>\n<h2>Creating an inherited process<a name=\"Inheritance\"><\/a><\/h2>\n<p>The first step to enable customization is creating an inherited process.\u00a0 Inherited processes can be created from any of the \u201cout of the box\u201d system processes. As shown in Figure 3 above, right clicking on a system process shows a context menu with \u201cCreate inherited process\u201d.\u00a0 This action opens a wizard (figure 3) where you create the inherited process which is the container for all customizations.\u00a0 Once you have created the inherited process, you can create new projects or start customizing it.<\/p>\n<p>You may be wondering how you can customize existing projects since they were created using system processes.\u00a0 Project migration is your answer.\u00a0 As part of the create process wizard, you can optionally migrate a project to use the inherited processes (figure 4).\u00a0 Once a project is migrated all customizations in the inherited process will immediately be seen in that project.\u00a0 This process is 100% reversible, simply migrate the project back to the system process.\u00a0 You can migrate projects between system and its inherited processes at any time by right clicking on the current process the projects are using and choosing \u201cMigrate projects\u201d from the context menu.\u00a0 History for existing work item types is preserved so there is no data loss.<\/p>\n<p>Currently there is no way to migrate team projects laterally, i.e. you can\u2019t convert an Agile project to Scrum, but that\u2019s on our long term backlog.<\/p>\n<table border=\"0\">\n<tbody>\n<tr>\n<td style=\"width: 50%\">\n        \u00a0<a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/7080.Figure204.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/7080.Figure204.png\" alt=\"\" border=\"0\" \/><\/a>\n      <\/td>\n<td style=\"width: 50%\">\n        \u00a0<a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/5482.Figure205.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/5482.Figure205.png\" alt=\"\" border=\"0\" \/><\/a>\n      <\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top\">\n        Figure 3. Creating an inherited process is as simple as choosing a name and optionally providing a description.\n      <\/td>\n<td style=\"vertical-align: top\">\n        Figure 4. Once the new inherited process is created, you are offered the chance to migrate existing projects to the new process. In this example, we\u2019re taking an existing project \u201cChatter\u201d and enabling customization by migrating it to the newly created inherited process \u201cMy Scrum\u201d. This action is reversible and the project will lose the customizations.\n      <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Process security<a name=\"ProcessSecurity\"><\/a><\/h2>\n<p>We\u2019ve made some improvements to the security model around process as well.\u00a0 Each process is a securable unit and has individual ACLs for creating inherited processes, editing the process and deleting the process.\u00a0 At the collection level, team project collection administrators can choose which processes can be inherited from and by whom.\u00a0 When a new inherited process is created, the creator of the process, as well as team project collection administrators, has full control of the process and can also set individual ACLs for which users and groups can edit and delete the process (figure 5).<\/p>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>\n        \u00a0<a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/5327.Figure206.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/5327.Figure206.png\" alt=\"\" border=\"0\" \/><\/a>\n      <\/td>\n<\/tr>\n<tr>\n<td>\n        Figure 5. Justin Marks is the owner of \u201cMy Scrum\u201d process and has full control but he has also granted Derrick Fu the ability to edit the process.\n      <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Now the moment you\u2019ve all been waiting for, let\u2019s add a field\u2026<\/p>\n<h2>Add custom fields to existing work item types<a name=\"AddFields\"><\/a><\/h2>\n<p>When we talk to customers about process customization, the most common ask we hear is something like, \u201cWhy can\u2019t I add a \u2018Date due\u2019 field to the Scrum bug?\u201d\u00a0 Now you can! Let&#8217;s go through that exact scenario and add a date field called &#8220;Date due&#8221; to the bug work item type (figure 6)&#8230;<\/p>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>\n        \u00a0<a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/8713.Figure206202.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/8713.Figure206202.png\" alt=\"\" border=\"0\" \/><\/a>\n      <\/td>\n<\/tr>\n<tr>\n<td>\n        Figure 6. I want to add a \u201cdate due\u201d field to the bug work item type.\n      <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>We have provided the beginnings of a full process editor as part of the admin site (figure 7).\u00a0 You can navigate to the admin site by clicking the customize button on the work item toolbar (figure 6) or by clicking on a process name from the process overview page (figure 2).<\/p>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>\n        \u00a0<a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/8726.Figure2012.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/8726.Figure2012.png\" alt=\"\" border=\"0\" \/><\/a>\n      <\/td>\n<\/tr>\n<tr>\n<td>\n        Figure 7. The process admin site shows all fields included on each work item.\n      <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The process editor allows you to see all fields on each work item type and access the add a field experience by clicking the &#8220;New field&#8221; button in the toolbar.\u00a0This opens the \u201cAdd a field\u201d dialog (figure 8) where users can create a brand new field or use an existing field that\u2019s not already associated with the work item type.\u00a0 When you add a new field, you have to provide a name for the field, choose the type (e.g. integer, date\/time, string, etc.) and optionally provide a description for what the field is.\u00a0 Clicking the \u201cadd field\u201d button will add the field to the work item type and display the field on the form (figure 11).\u00a0 It\u2019s that easy!<\/p>\n<p>In addition to defining the field itself, you can use the Layout and Options tabs to provide more options:<\/p>\n<ul>\n<li>The Layout tab allows you choose how the field will appear on the work item form.\u00a0 You can hide the field from the form, customize the field label, and choose which group the field appears in (figure 9).<\/li>\n<li>The Options tab allows you provide additional options about the field such as whether the field is required and its default value (figure 10).<\/li>\n<\/ul>\n<p>These options are also available from the process editor by right clicking on a field in the grid.\u00a0 You can also see a rollup of all fields across the process by clicking on the Fields tab at the top of the page.<\/p>\n<p>These added fields have all the same functionality of any other field: you can query for them, set alerts on them, use them as pivots in charts, show them on the backlog, etc.<\/p>\n<table border=\"0\">\n<tbody>\n<tr>\n<td style=\"width: 33%\">\n        \u00a0<a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/2043.Figure208.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/2043.Figure208.png\" alt=\"\" border=\"0\" \/><\/a>\n      <\/td>\n<td style=\"width: 33%\">\n        \u00a0<a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/1323.Figure209.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/1323.Figure209.png\" alt=\"\" border=\"0\" \/><\/a>\n      <\/td>\n<td style=\"width: 33%\">\n        \u00a0<a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/2451.Figure2010.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/2451.Figure2010.png\" alt=\"\" border=\"0\" \/><\/a>\n      <\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top\">\n        Figure 8. The \u201cDefine Field\u201d tab of the add a field dialog allows you to choose from existing fields or create a new custom field.\n      <\/td>\n<td style=\"vertical-align: top\">\n        Figure 9. The \u201cLayout\u201d tab of the add a field dialog allows you to choose whether the work item appears on the form, with what label, and in which group.\n      <\/td>\n<td style=\"vertical-align: top\">\n        Figure 10. The \u201cOptions\u201d tab of the add a field dialog allows you to optionally make the field required or set a default value for the field.\n      <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>\n        \u00a0<a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/3683.Figure2011.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/3683.Figure2011.png\" alt=\"\" border=\"0\" \/><\/a>\n      <\/td>\n<\/tr>\n<tr>\n<td>\n        Figure 11. The bug work item with the newly created \u201cDate due\u201d field added to it (highlighted in orange).\u00a0 The field has the default value provided in the add a field dialog.\n      <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>That wraps it up for our first phase of process customization.\u00a0 Check out our <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/\">customization futures<\/a> blog post to stay up to date with what\u2019s coming next and our overall rollout plan.<\/p>\n<p>Happy Customizing!<\/p>\n<p>-Justin Marks<\/p>\n<h2>Q&amp;A<\/h2>\n<p><strong>Q: How can I make process changes to a single project?<\/strong><\/p>\n<p>A: If you wish to have a project have its own process, simply create an inherited process and migrate the project to use it.\u00a0 Just because processes are shared doesn\u2019t mean you need multiple projects using it J<\/p>\n<p>\u00a0<\/p>\n<p><strong>Q: When I migrate a project from \u201cAgile\u201d to \u201cMy custom agile\u201d, what happens?<\/strong><\/p>\n<p>A: Once a project is migrated, the work item appears in the UI no differently than if it was created that process all along; the newly added fields will simply appear on the work item form.\u00a0 If any new required fields have been added, the work item will be in an invalid state and won\u2019t be able to be saved until the required fields are populated.<\/p>\n<p>\u00a0<\/p>\n<p><strong>Q: What happens to the work item data when it\u2019s migrated from an inherited process \u201cMy custom agile\u201d back to the system process \u201cAgile\u201d?<\/strong><\/p>\n<p>A: All data is retained in the work item history so looking at the history tab will show you all the changes made regardless of the current process.\u00a0 Some fields may not be on the form since they are not part of the process but the data is still accessible through REST APIs and Query.\u00a0 These fields are essentially locked from changes and appear as read-only values.<\/p>\n<p>\u00a0<\/p>\n<p><strong>Q: Can I change the name or type of a field?<\/strong><\/p>\n<p>A: The type can never be changed but the name of user defined fields can be changed from the process fields page but note that this affects all instances of the field across all work item types.<\/p>\n<p>\u00a0<\/p>\n<p><strong>Q: What types of fields can I create?<\/strong><\/p>\n<p>A: Currently, we support the following field types: Decimal, Date\/Time, Integer, String (single-line).\u00a0 While this is a small list, we are working to add more to this list over the next couple sprints.\u00a0 We\u2019ll have Boolean, HTML, and String (multi-line) very soon after release and we\u2019re working to bring picklist\/drop downs right after the holidays.<\/p>\n<p>\u00a0<\/p>\n<p><strong>Q: Can I remove fields from OOB templates that we don\u2019t use?<\/strong><\/p>\n<p>A: Inherited processes don\u2019t allow you to remove fields from the system process they inherit from.\u00a0 You will be able to hide the fields from the form next sprint.<\/p>\n<p>\u00a0<\/p>\n<p><strong>Q: What should I do if I have more questions or need help?<\/strong><\/p>\n<p>A: If you run into trouble, feel free to email <a href=\"mailto:vsocustpt@microsoft.com\">VSTS Customization Help<\/a> and we\u2019ll be happy to help you out!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Thank you everyone for your patience, but the wait is finally over.\u00a0 Today begins our journey delivering process customization to Visual Studio Team Services (VSTS)!\u00a0 We\u2019re releasing the first stage of the rollout plan I described back in July, the ability to add custom fields &#038; modify layout for existing work item types.\u00a0 Before jumping [&hellip;]<\/p>\n","protected":false},"author":174,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[227,253,1],"tags":[],"class_list":["post-10652","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-agile","category-azure-devops-server","category-devops"],"acf":[],"blog_post_summary":"<p>Thank you everyone for your patience, but the wait is finally over.\u00a0 Today begins our journey delivering process customization to Visual Studio Team Services (VSTS)!\u00a0 We\u2019re releasing the first stage of the rollout plan I described back in July, the ability to add custom fields &#038; modify layout for existing work item types.\u00a0 Before jumping [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/10652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/174"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=10652"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/10652\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=10652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=10652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=10652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}