I am updating existing Workitem Template to have a new field that should be "MultiLineControl". Below is what all i did.
1) Changed WorkItem template as
<FIELD name="IssueOwner" refname="test.IssueOwner" type="String" reportable="dimension" >
<HELPTEXT>Issue Owner</HELPTEXT>
<SUGGESTEDVALUES expanditems="true">
<LISTITEM value="test1" />
<LISTITEM value="test2" />
<LISTITEM value="test3" />
</SUGGESTEDVALUES>
</FIELD>
<Control FieldName="test.IssueOwner" Type="FieldControl" PreferredType="MultiValueControl" Label="Issue Owner" LabelPosition="Left" />
2) Installed extension First i tried from below location under "Install control on Web Access"
https://devblogs.microsoft.com/devops/multivaluelist-control-in-tfs-work-item-tracking/
But then the extension is deprecated for TFS 2017
So then I installed
https://marketplace.visualstudio.com/items?itemName=ms-devlabs.vsts-extensions-multivalue-control
But still my field is Simple dropdown. Not sure what i am missing. Can someone plz help
Update 1) I also tried stuff from Entension but it doesn't effect any change. in my Work Item export I have two section in FORM. Layout and WebLayout. The link talks abt changing WebLayout. But how to change Layout as thats what my TFS load when i use it on explorer?
Tested on TFS 2017 (Version 15.117.27414.0), everything works as expected.
Please follow below steps to do that:
Install Multivalue control extension.
Export the specific WIT with witadmin tool (you can also use the TFS Process Template Editorif you are using Visual Studio 2015 or 2017, reference this thread for details. ) :
witadmin exportwitd /collection:CollectionURL /p:Project /n:TypeName /f:FileName
Open the exported xml file with text editor and add an Extensiontag to make the control available to the work item form.
<Extensions>
<Extension Id="ms-devlabs.vsts-extensions-multivalue-control" />
</Extensions>
Add your customized field:
<FIELD name="IssueOwner" refname="test.IssueOwner" type="String" reportable="dimension" >
<HELPTEXT>Issue Owner</HELPTEXT>
<SUGGESTEDVALUES expanditems="true">
<LISTITEM value="test1" />
<LISTITEM value="test2" />
<LISTITEM value="test3" />
</SUGGESTEDVALUES>
</FIELD>
Add the ControlContribution tag for your Multivalue control. This
example adds it to the "Status" group.
<Group Label="Status">
<Control Label="Reason" Type="FieldControl" FieldName="System.Reason" />
<ControlContribution Label="IssueOwner" Id="ms-devlabs.vsts-extensions-multivalue-control.multivalue-form-control">
<Inputs>
<Input Id="FieldName" Value="test.IssueOwner" />
</Inputs>
</ControlContribution>
</Group>
Import the modified xml file to your project:
witadmin importwitd /collection:CollectionURL /p:Project /n:TypeName /f:FileName
Check the result:
Related
I am trying to adjust the Bug forms "Severity" to have a new custom field value on creation of "new" (currently it shows 3 of a 1 to 5 choice) however I cant find any specific examples of how to do this , e.g. https://learn.microsoft.com/en-us/vsts/work/customize/add-modify-wit does not go into detail We want to explicitly show that the severity has not explicitly been set yet.
=> Tips or Urls please ?
Below is the default content from a "witadmin exportprocessconfig" command. I am on TFs 2017 up3
<BugWorkItems category="Microsoft.BugCategory" pluralName="Bugs" singularName="Bug">
<States>
<State type="Proposed" value="New" />
<State type="Proposed" value="Approved" />
<State type="InProgress" value="Committed" />
<State type="Complete" value="Done" />
</States>
You need to modify the Bug.xml file to add a new LISTITEM in Severity field rule. Check the example below:
<FieldDefinition name=" refname="Microsoft.VSTS.Common.Severity" type="String" reportable="dimension">
<DEFAULT from="value" value="3 - Medium" />
<ALLOWEDVALUES expanditems="true">
<LISTITEM value="1 - Critical" />
<LISTITEM value="2 - High" />
<LISTITEM value="3 - Medium" />
<LISTITEM value="4 - Low" />
<LISTITEM value="5 - NewCustom" />
</ALLOWEDVALUES>
</FieldDefinition>
Is there a straightforward way to create a new C++ project that clones the settings of an existing project? When developing C++, I like to write many small tests and examples, but if my code depends on external libraries, as they often do, I have to set the includes, libraries, compiler settings, etc., up from scratch each time. Is there some sort of template mechanism?
I know about Export/Import of C/C++ Project Settings. However, this only appears to pick up include paths and #defines for the C++ compilation. The fact that it doesn't export the full slate of settings (compiler options, warning settings, linker options, libraries, library paths, ...) really limit its usefulness.
Also, you have to do it separately for each run configuration, though this is a minor inconvenience.
What I usually resort to is copying one test project and manually editing the .project and .cproject files and then nuking and replacing the files. But this seems like an error-prone hack.
Are there other approaches? Do I need to switch to a separate build system and generate the eclipse projects externally in order to have what seems like pretty basic functionality?
UPDATE
I've tried creating a Plug-in Project but the instructions leave more than a little to be desired if you haven't done this before. I definitely want to figure out how to do this.
I copied and modified the sample template in some very simple ways, just to get started, but the "How to register a project template with CDT" instructions lost me from the start: "1. Create an empty plug-in project from the Eclipse workbench without the source folders." I assume this requires installing the PDE, which I did, but then I'm lost. I tried "File / New / Plug-in Project", deselected "Create a Java Project" (I assumed this was what was meant by "Empty"). This creates a project that still has a lot of stuff in it. I then created the subdirectories as described in step 2, but can't figure out how to get these to show up in Eclipse, and as a result I can't browse to the template XML file in step 11. Also, in steps 9/10, I don't get a template 'literally named "(template)"' - instead it creates one with the full name of my template project.
CDT has a complete Templating mechanism for creating new projects.
Basically, you extend the org.eclipse.cdt.core.templates extension point and that points to a template.xml file that has a bunch of commands you can do. You don't need to write any Java code for this, but you do need to create a Plug-in project.
The kinds of things you can do:
Create folders
Add files to a project
Set Managed Build settings (this is the one most relevant because you can set compiler options and add libraries, etc)
Add extra pages to the New Project Wizard to prompt user for extra information
The Eclipse documentation has a special section giving a run down on how to do it here: http://help.eclipse.org/mars/topic/org.eclipse.cdt.doc.isv/guide/projectTemplateEngine/index.html
The Hello World project that comes with CDT has its template here: https://github.com/eclipse/cdt/blob/master/build/org.eclipse.cdt.managedbuilder.gnu.ui/templates/projecttemplates/HelloWorldCAnsiProject/template.xml
A little note, if you initially create your plug-in to install as a non-packed plug-in, you can edit it in place, adding new templates or editing the one you have already done.
Going further, you can share this template plug-in project with your team and all benefit from having this feature.
Step-by-step
The step by step process to do this (tested on Eclipse Mars.1 with CDT and Plug-in development tools installed plus an XML editor for editing the template.xml)
Create a Plug-in project (File | New | Other... | Plug-in project)
Fill in a project name and press Next / Finish until done
You should now have files on your disk that looks like this in the project you created:
$ find . -type f
./.classpath
./bin/com/example/cdt/templates/Activator.class
./.project
./src/com/example/cdt/templates/Activator.java
./.settings/org.eclipse.jdt.core.prefs
./META-INF/MANIFEST.MF
./build.properties
Open the plug-in.xml and do the following
Select the Extensions tab
Press Add
Type the extension point org.eclipse.cdt.core.templates
Un-check the Show only extension points [...] checkbox
Select the org.eclipse.cdt.core.templates from the list
Press Finish
Say Yes to adding dependency
Add the required settings to the plugin.xml as shown in the screenshot and given in the plugin.xml code sample after.
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.cdt.core.templates">
<template
filterPattern=".*gcc"
id="com.example.cdt.templates.template1"
location="template/template.xml"
projectType="org.eclipse.cdt.build.core.buildArtefactType.exe">
</template>
</extension>
</plugin>
Now create the template.xml in the location specified in the plugin.xml (template/template.xml) with these contents:
<?xml version="1.0" encoding="ISO-8859-1"?>
<template type="ProjTempl" version="1.0" supplier="Stack Overflow"
revision="1.0" author="Jonah Graham" id="EXE" label="Stack Overflow Example"
description="An example for https://stackoverflow.com/questions/33092746/creating-a-new-c-project-in-eclipse-cdt-with-the-same-settings-as-another-proj."
help="help.html">
<process type="org.eclipse.cdt.managedbuilder.core.NewManagedProject">
<simple name="name" value="$(projectName)" />
<simple name="artifactExtension" value="exe" />
<simple name="isCProject" value="true" />
</process>
<process type="org.eclipse.cdt.core.CreateSourceFolder">
<simple name="projectName" value="$(projectName)" />
<simple name="path" value="src" />
</process>
<process type="org.eclipse.cdt.core.AddFiles">
<simple name="projectName" value="$(projectName)" />
<complex-array name="files">
<element>
<simple name="source" value="src/basename.c" />
<simple name="target" value="src/$(projectName).c" />
<simple name="replaceable" value="true" />
</element>
</complex-array>
</process>
<process type="org.eclipse.cdt.ui.OpenFiles">
<simple name="projectName" value="$(projectName)" />
<complex-array name="files">
<element>
<simple name="target" value="src/$(projectName).c" />
</element>
</complex-array>
</process>
<!-- Set -Wall by checking the checkbox in the settings -->
<process
type="org.eclipse.cdt.managedbuilder.core.SetMBSBooleanOptionValue">
<simple name="projectName" value="$(projectName)" />
<complex-array name="resourcePaths">
<element>
<simple name="id" value=".*compiler\.option\.warnings\.extrawarn.*" />
<simple name="value" value="true" />
<simple name="path" value="" />
</element>
</complex-array>
</process>
<!-- Set -Werror by adding textual build settings -->
<process
type="org.eclipse.cdt.managedbuilder.core.SetMBSStringOptionValue">
<simple name="projectName" value="$(projectName)" />
<complex-array name="resourcePaths">
<element>
<simple name="id" value=".*compiler\.option\.misc\.other.*" />
<simple name="value" value="-c -fmessage-length=0 -Werror" />
<simple name="path" value="" />
</element>
</complex-array>
</process>
<!-- Add -lmylibname to libraries to link -->
<process
type="org.eclipse.cdt.managedbuilder.core.AppendToMBSStringListOptionValues">
<simple name="projectName" value="$(projectName)" />
<complex-array name="resourcePaths">
<element>
<simple name="id" value=".*link\.option\.libs.*" />
<simple-array name="values">
<element value="mylibname" />
</simple-array>
<simple name="path" value="" />
</element>
</complex-array>
</process>
</template>
Add the source file listed in the template with any content you want in template/src/basename.c
You should now have a directory structure that looks like this:
$ find . -type f
./.classpath
./template/src/basename.c
./template/template.xml
./bin/com/example/cdt/templates/Activator.class
./.project
./src/com/example/cdt/templates/Activator.java
./.settings/org.eclipse.jdt.core.prefs
./META-INF/MANIFEST.MF
./plugin.xml
./build.properties
Launch the Eclipse Application to test (Run menu | Run As | Eclipse Application). You can also right-click on the project and choose Run As | Eclipse Application.
In the newly running Eclipse, start a new project wizard and select your new C project type:
Running a build shows the new settings (the error is expected as I don't actually have a library called mylibname):
Building file: ../src/hello2.c
Invoking: GCC C Compiler
gcc -O0 -g3 -Wall -Wextra -c -fmessage-length=0 -Werror -MMD -MP -MF"src/hello2.d" -MT"src/hello2.o" -o "src/hello2.o" "../src/hello2.c"
Finished building: ../src/hello2.c
Building target: hello2
Invoking: GCC C Linker
gcc -o "hello2" ./src/hello2.o -lmylibname
/usr/bin/ld: cannot find -lmylibname
collect2: error: ld returned 1 exit status
make: *** [hello2] Error 1
The tricky part?
You may need to examine the .cproject file from your base project to determine the magic strings that go in the id fields. For example, in my .cproject for -Wextra I can see this:
<option id="gnu.c.compiler.option.warnings.extrawarn.176373860" name="Extra warnings (-Wextra)" superClass="gnu.c.compiler.option.warnings.extrawarn" value="true" valueType="boolean"/>
That translates to this command in the template.xml:
<!-- Set -Wall by checking the checkbox in the settings -->
<process
type="org.eclipse.cdt.managedbuilder.core.SetMBSBooleanOptionValue">
<simple name="projectName" value="$(projectName)" />
<complex-array name="resourcePaths">
<element>
<simple name="id" value=".*compiler\.option\.warnings\.extrawarn.*" />
<simple name="value" value="true" />
<simple name="path" value="" />
</element>
</complex-array>
</process>
The id goes from gnu.c.compiler.option.warnings.extrawarn.176373860 to regexp .*compiler\.option\.warnings\.extrawarn.*. The beginning is .* so that this applies to C and C++ compiler options as the C++ id would have started with gnu.cc.compiler[...] and I get rid of the end with .* because the number and suffix is not known to you in the template.xml
Next steps
When you are done, see Launching Eclipse plug in template for how to export the plug-in into your running Eclipse.
I like Jonah's answer, it is very informative. Lately I've been using Ease and Py4J to automatically re-recreate a large number of projects with the cdt settings I need. I just wanted to mention another possible way of doing this type of automation.
Create your template project , store it in some workspace, doesn't necessarily need to be in the same workspace as the one you are importing to
File->Import->Gneral->Existing Projects-> Select your template project directory
Select "Copy projects into workspace" option
Finish
Optionally rename the project, this way when you import the project again as a new project, there will be no naming conflicts
Is there a straightforward way to create a new C++ project that clones the settings of an existing project? When developing C++, I like to write many small tests and examples, but if my code depends on external libraries, as they often do, I have to set the includes, libraries, compiler settings, etc., up from scratch each time. Is there some sort of template mechanism?
I know about Export/Import of C/C++ Project Settings. However, this only appears to pick up include paths and #defines for the C++ compilation. The fact that it doesn't export the full slate of settings (compiler options, warning settings, linker options, libraries, library paths, ...) really limit its usefulness.
Also, you have to do it separately for each run configuration, though this is a minor inconvenience.
What I usually resort to is copying one test project and manually editing the .project and .cproject files and then nuking and replacing the files. But this seems like an error-prone hack.
Are there other approaches? Do I need to switch to a separate build system and generate the eclipse projects externally in order to have what seems like pretty basic functionality?
UPDATE
I've tried creating a Plug-in Project but the instructions leave more than a little to be desired if you haven't done this before. I definitely want to figure out how to do this.
I copied and modified the sample template in some very simple ways, just to get started, but the "How to register a project template with CDT" instructions lost me from the start: "1. Create an empty plug-in project from the Eclipse workbench without the source folders." I assume this requires installing the PDE, which I did, but then I'm lost. I tried "File / New / Plug-in Project", deselected "Create a Java Project" (I assumed this was what was meant by "Empty"). This creates a project that still has a lot of stuff in it. I then created the subdirectories as described in step 2, but can't figure out how to get these to show up in Eclipse, and as a result I can't browse to the template XML file in step 11. Also, in steps 9/10, I don't get a template 'literally named "(template)"' - instead it creates one with the full name of my template project.
CDT has a complete Templating mechanism for creating new projects.
Basically, you extend the org.eclipse.cdt.core.templates extension point and that points to a template.xml file that has a bunch of commands you can do. You don't need to write any Java code for this, but you do need to create a Plug-in project.
The kinds of things you can do:
Create folders
Add files to a project
Set Managed Build settings (this is the one most relevant because you can set compiler options and add libraries, etc)
Add extra pages to the New Project Wizard to prompt user for extra information
The Eclipse documentation has a special section giving a run down on how to do it here: http://help.eclipse.org/mars/topic/org.eclipse.cdt.doc.isv/guide/projectTemplateEngine/index.html
The Hello World project that comes with CDT has its template here: https://github.com/eclipse/cdt/blob/master/build/org.eclipse.cdt.managedbuilder.gnu.ui/templates/projecttemplates/HelloWorldCAnsiProject/template.xml
A little note, if you initially create your plug-in to install as a non-packed plug-in, you can edit it in place, adding new templates or editing the one you have already done.
Going further, you can share this template plug-in project with your team and all benefit from having this feature.
Step-by-step
The step by step process to do this (tested on Eclipse Mars.1 with CDT and Plug-in development tools installed plus an XML editor for editing the template.xml)
Create a Plug-in project (File | New | Other... | Plug-in project)
Fill in a project name and press Next / Finish until done
You should now have files on your disk that looks like this in the project you created:
$ find . -type f
./.classpath
./bin/com/example/cdt/templates/Activator.class
./.project
./src/com/example/cdt/templates/Activator.java
./.settings/org.eclipse.jdt.core.prefs
./META-INF/MANIFEST.MF
./build.properties
Open the plug-in.xml and do the following
Select the Extensions tab
Press Add
Type the extension point org.eclipse.cdt.core.templates
Un-check the Show only extension points [...] checkbox
Select the org.eclipse.cdt.core.templates from the list
Press Finish
Say Yes to adding dependency
Add the required settings to the plugin.xml as shown in the screenshot and given in the plugin.xml code sample after.
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.cdt.core.templates">
<template
filterPattern=".*gcc"
id="com.example.cdt.templates.template1"
location="template/template.xml"
projectType="org.eclipse.cdt.build.core.buildArtefactType.exe">
</template>
</extension>
</plugin>
Now create the template.xml in the location specified in the plugin.xml (template/template.xml) with these contents:
<?xml version="1.0" encoding="ISO-8859-1"?>
<template type="ProjTempl" version="1.0" supplier="Stack Overflow"
revision="1.0" author="Jonah Graham" id="EXE" label="Stack Overflow Example"
description="An example for https://stackoverflow.com/questions/33092746/creating-a-new-c-project-in-eclipse-cdt-with-the-same-settings-as-another-proj."
help="help.html">
<process type="org.eclipse.cdt.managedbuilder.core.NewManagedProject">
<simple name="name" value="$(projectName)" />
<simple name="artifactExtension" value="exe" />
<simple name="isCProject" value="true" />
</process>
<process type="org.eclipse.cdt.core.CreateSourceFolder">
<simple name="projectName" value="$(projectName)" />
<simple name="path" value="src" />
</process>
<process type="org.eclipse.cdt.core.AddFiles">
<simple name="projectName" value="$(projectName)" />
<complex-array name="files">
<element>
<simple name="source" value="src/basename.c" />
<simple name="target" value="src/$(projectName).c" />
<simple name="replaceable" value="true" />
</element>
</complex-array>
</process>
<process type="org.eclipse.cdt.ui.OpenFiles">
<simple name="projectName" value="$(projectName)" />
<complex-array name="files">
<element>
<simple name="target" value="src/$(projectName).c" />
</element>
</complex-array>
</process>
<!-- Set -Wall by checking the checkbox in the settings -->
<process
type="org.eclipse.cdt.managedbuilder.core.SetMBSBooleanOptionValue">
<simple name="projectName" value="$(projectName)" />
<complex-array name="resourcePaths">
<element>
<simple name="id" value=".*compiler\.option\.warnings\.extrawarn.*" />
<simple name="value" value="true" />
<simple name="path" value="" />
</element>
</complex-array>
</process>
<!-- Set -Werror by adding textual build settings -->
<process
type="org.eclipse.cdt.managedbuilder.core.SetMBSStringOptionValue">
<simple name="projectName" value="$(projectName)" />
<complex-array name="resourcePaths">
<element>
<simple name="id" value=".*compiler\.option\.misc\.other.*" />
<simple name="value" value="-c -fmessage-length=0 -Werror" />
<simple name="path" value="" />
</element>
</complex-array>
</process>
<!-- Add -lmylibname to libraries to link -->
<process
type="org.eclipse.cdt.managedbuilder.core.AppendToMBSStringListOptionValues">
<simple name="projectName" value="$(projectName)" />
<complex-array name="resourcePaths">
<element>
<simple name="id" value=".*link\.option\.libs.*" />
<simple-array name="values">
<element value="mylibname" />
</simple-array>
<simple name="path" value="" />
</element>
</complex-array>
</process>
</template>
Add the source file listed in the template with any content you want in template/src/basename.c
You should now have a directory structure that looks like this:
$ find . -type f
./.classpath
./template/src/basename.c
./template/template.xml
./bin/com/example/cdt/templates/Activator.class
./.project
./src/com/example/cdt/templates/Activator.java
./.settings/org.eclipse.jdt.core.prefs
./META-INF/MANIFEST.MF
./plugin.xml
./build.properties
Launch the Eclipse Application to test (Run menu | Run As | Eclipse Application). You can also right-click on the project and choose Run As | Eclipse Application.
In the newly running Eclipse, start a new project wizard and select your new C project type:
Running a build shows the new settings (the error is expected as I don't actually have a library called mylibname):
Building file: ../src/hello2.c
Invoking: GCC C Compiler
gcc -O0 -g3 -Wall -Wextra -c -fmessage-length=0 -Werror -MMD -MP -MF"src/hello2.d" -MT"src/hello2.o" -o "src/hello2.o" "../src/hello2.c"
Finished building: ../src/hello2.c
Building target: hello2
Invoking: GCC C Linker
gcc -o "hello2" ./src/hello2.o -lmylibname
/usr/bin/ld: cannot find -lmylibname
collect2: error: ld returned 1 exit status
make: *** [hello2] Error 1
The tricky part?
You may need to examine the .cproject file from your base project to determine the magic strings that go in the id fields. For example, in my .cproject for -Wextra I can see this:
<option id="gnu.c.compiler.option.warnings.extrawarn.176373860" name="Extra warnings (-Wextra)" superClass="gnu.c.compiler.option.warnings.extrawarn" value="true" valueType="boolean"/>
That translates to this command in the template.xml:
<!-- Set -Wall by checking the checkbox in the settings -->
<process
type="org.eclipse.cdt.managedbuilder.core.SetMBSBooleanOptionValue">
<simple name="projectName" value="$(projectName)" />
<complex-array name="resourcePaths">
<element>
<simple name="id" value=".*compiler\.option\.warnings\.extrawarn.*" />
<simple name="value" value="true" />
<simple name="path" value="" />
</element>
</complex-array>
</process>
The id goes from gnu.c.compiler.option.warnings.extrawarn.176373860 to regexp .*compiler\.option\.warnings\.extrawarn.*. The beginning is .* so that this applies to C and C++ compiler options as the C++ id would have started with gnu.cc.compiler[...] and I get rid of the end with .* because the number and suffix is not known to you in the template.xml
Next steps
When you are done, see Launching Eclipse plug in template for how to export the plug-in into your running Eclipse.
I like Jonah's answer, it is very informative. Lately I've been using Ease and Py4J to automatically re-recreate a large number of projects with the cdt settings I need. I just wanted to mention another possible way of doing this type of automation.
Create your template project , store it in some workspace, doesn't necessarily need to be in the same workspace as the one you are importing to
File->Import->Gneral->Existing Projects-> Select your template project directory
Select "Copy projects into workspace" option
Finish
Optionally rename the project, this way when you import the project again as a new project, there will be no naming conflicts
We're testing G-Reg for use of a SOA repository. The default types are Services, WSDL's, Schemas and WS Policies, we're triying to add a new type (Persons for example).
Once added, we want to create a xml to specify the fields that needs to be filled to upload a new resource of the "Persons" type, (like the Services type actual funcionality).
We've followed the guide on http://docs.wso2.org/wiki/display/Governance411/Configurable+Governance+Artifacts, but with no success of creating the example named "Events", because there exists contradictory information, the path "/_system/governance/repository/components/org.wso2.carbon.governance/types", doesn't exists on GREG 4.1.1, so where is supposed the content to be uploaded?
And, the guide explains about a "registry extension file" and a "content", which is the difference between them?, they need a name?, content.xml and extfile.xml perhaps?
Any orientation will be greatly appreciated
Thanks,
Gabriel.
Here is a sample server.rxt file I have created.
<artifactType type="application/vnd.wso2-server+xml" shortName="server" singularLabel="Server" pluralLabel="Servers" hasNamespace="false" iconSet="5">
<storagePath>/servers/#{overview_name}/</storagePath>
<ui>
<list>
<column name="Name">
<data type="path" value="overview_name" href="#{storagePath}"/>
</column>
</list>
</ui>
<content>
<table name="Overview">
<field type="text" required="true">
<name label="name">Name</name>
</field>
<field type="text" required="true">
<name label="url">url</name>
</field>
<field type="text" required="true">
<name label="username">username</name>
</field>
<field type="text" required="true">
<name label="password">password</name>
</field>
</table>
</content>
</artifactType>
you need to save this under the directory you have mentioned.
/_system/governance/repository/components/org.wso2.carbon.governance/types
this location is not exits. But you need to create this directory and save.
After restart you should see the new type under meta data list
I am trying to add a new string field (IterationCompleted) to the bug work item in tfs2010. Using the TFS 2010 power tools I edited the work item adding the new field. This results in the following XML
<FieldDefinition reportable="dimension" refname="DevX.IterationCompleted" name="Iteration Completed" type="String">
<ALLOWEDVALUES>
<GLOBALLIST name="Iterations" />
</ALLOWEDVALUES>
<ALLOWEXISTINGVALUE />
<DEFAULT from="value" value="∞" />
</FieldDefinition>
I added it to the form next to some related fields. Here is the relevant XML
<Group Label="Classification">
<Column PercentWidth="100">
<Control FieldName="System.AreaPath" Type="WorkItemClassificationControl" Label="&Area:" LabelPosition="Left" />
<Control FieldName="System.IterationPath" Type="WorkItemClassificationControl" Label="Ite&ration Found:" LabelPosition="Left" />
<Control FieldName="DevX.IterationCompleted" Type="FieldControl" Label="Iteration Resolved:" LabelPosition="Left" Name="IterationCompleted" />
<Control FieldName="DevX.Customer" Type="FieldControl" Label="Customer:" LabelPosition="Left" />
<Control FieldName="DevX.ReleaseNotes" Type="FieldControl" Label="Include in Release Notes:" LabelPosition="Left" />
<Control FieldName="DevX.Billable" Type="FieldControl" Label="Billable:" LabelPosition="Left" Name="Billable" />
</Column>
</Group>
It is not involved in the workflow at all.
The problem I'm having is in the form. For new bugs, the field appears as expected and is editable (Iteration Resolved):
For old bugs however, the field is not editable. In fact there is no control at all there to input anything:
I found a similar question with an accepted answer to make sure the field is String and that on the Form the type is set to FieldControl. As you can see I have done that and still get the results I am seeing above. I have successfully added fields in the past and never encountered this problem. Does anyone know what I can do to get this field editable in old bugs?
I came across the same behaviour... Or at least similar...
I had to add default values for all the lists..
When I did not have a default value, any WIT's which had already been created could not have there values set, as it was not a ALLOWEDVAULES LISTITEM...
(Note: This code/XML changes the value of a list depending on the state of the WIT)
Sample:
<FIELD reportable="dimension" refname="GovDept.ActionRequiredTFS" name="Action Reqd TFS" type="String">
<WHEN field="System.State" value="Proposed">
<ALLOWEDVALUES>
<LISTITEM value="Assess" />
<LISTITEM value="Prioritize" />
</ALLOWEDVALUES>
<DEFAULT from="value" value="Assess" />
</WHEN>
<WHEN field="System.State" value="Active">
<ALLOWEDVALUES>
<LISTITEM value="IA Complete" />
<LISTITEM value="Impact" />
<LISTITEM value="Implement" />
<LISTITEM value="Migrate" />
<LISTITEM value="Unit Test" />
<LISTITEM value="Fix Fail" />
</ALLOWEDVALUES>
<DEFAULT from="value" value="Impact" />
</WHEN>
<WHEN field="System.State" value="Resolved">
<ALLOWEDVALUES>
<LISTITEM value="Test" />
<LISTITEM value="Fix Fail" />
</ALLOWEDVALUES>
<DEFAULT from="value" value="Test" />
</WHEN>
<ALLOWEXISTINGVALUE />
</FIELD>
End of Sample
I just had this problem in TFS 2010 using VS2012.
Steps to reproduce:
Create custom field type:String
Add field to layout, ensure it is a FieldControl
Preview Form: Works fine
Go to a query and double click and existing work item of the type you are editing
(for me it was a Backlog Item.)
Observe no proper way to edit field, even if cursor shows in field. Appears to be read only.
After verifying the field was not read only (Property false in layout), I restarted Visual Studio after saving the edits.
That cleared the issue and the edit control started working normally. I can reproduce this over and over.
Dustin,
We have never heard of this behavior. If you want Microsoft to take a look at this issue, you can file a bug at https://connect.microsoft.com/visualstudio
Ewald Hofman
TFS Program Manager