index > Team Foundation Server - Work Item Tracking > <ALLOWEXISTINGVALUE> not valid for System.Reason

<ALLOWEXISTINGVALUE> not valid for System.Reason


Can anyone explain why <ALLOWEXISTINGVALUE> is not allowed for System.Reason. I would think this is just an ordinary string field.

Thanks.

paso
Tell me about it. I gave up on System.Reason and made my own because of its limitations.


Robert Kozak
Robert Kozak

Robert,

So what is the trick to creating new fields?

My attempts at creating new fields end up with

TF26201: This work item has unsupported fields, or user does not have permissions.

I am suspicious that Microsoft.VSTS... or System... are sacred places you can not add fields to, so I have tried creating them in MPRI.mynewname.  But still no dice.  It may be because I still have one field Microsoft.VSTS.Scheduling.EstimateOfWork that I haven't changed to MPRI.EstimateOfWork.

But there doesn't seem to be any way to determine just which field is unsupported




Scot S. Morgan
ssmorgan

Here is the section of one of my WorkItem types that has the new field and the WorkFlow. I also use GlobalLists alot so I included these also.

Hope this helps.

<FIELD name="DashReason" refname="Nowcom.Dash.Reason" type="String">

<WHEN field="System.State" value="Active">

<DEFAULT from = "value" value = "New" />

<REQUIRED />

<ALLOWEDVALUES>

<GLOBALLIST name="Bug.Reasons.Active" />

</ALLOWEDVALUES>

</WHEN>

<WHEN field="System.State" value="Ready to Test">

<DEFAULT from = "value" value = "Completed" />

<REQUIRED />

<ALLOWEDVALUES>

<GLOBALLIST name="Bug.Reasons.ReadyToTest" />

</ALLOWEDVALUES>

</WHEN>

<WHEN field="System.State" value="Resolved">

<DEFAULT from = "value" value = "Completed" />

<REQUIRED />

<ALLOWEDVALUES>

<GLOBALLIST name="Bug.Reasons.Resolved" />

</ALLOWEDVALUES>

</WHEN>

</FIELD>

</FIELDS>

<WORKFLOW>

<STATES>

<STATE value="Active">

<FIELDS>

<FIELD refname="Microsoft.VSTS.Common.ClosedDate">

<EMPTY />

</FIELD>

<FIELD refname="Microsoft.VSTS.Common.ClosedBy">

<EMPTY />

</FIELD>

</FIELDS>

</STATE>

<STATE value="Ready to Test" />

<STATE value="Resolved" />

</STATES>

<TRANSITIONS>

<TRANSITION from="" to="Active">

<REASONS>

<DEFAULTREASON value="New" />

</REASONS>

<FIELDS>

<FIELD refname="Microsoft.VSTS.Common.ActivatedBy">

<COPY from="currentuser" />

<VALIDUSER />

<REQUIRED />

</FIELD>

<FIELD refname="Microsoft.VSTS.Common.ActivatedDate">

<SERVERDEFAULT from="clock" />

</FIELD>

<FIELD refname="System.AssignedTo">

<DEFAULT from="currentuser" />

</FIELD>

</FIELDS>

</TRANSITION>

<TRANSITION from="Active" to="Ready to Test">

<REASONS>

<DEFAULTREASON value="Completed" />

</REASONS>

<FIELDS>

<FIELD refname="System.AssignedTo">

<DEFAULT from="currentuser" />

</FIELD>

</FIELDS>

</TRANSITION>

<TRANSITION from="Ready to Test" to="Active">

<REASONS>

<DEFAULTREASON value="Reactivated" />

</REASONS>

<FIELDS>

<FIELD refname="System.AssignedTo">

<DEFAULT from="currentuser" />

</FIELD>

</FIELDS>

</TRANSITION>

<TRANSITION from="Ready to Test" to="Resolved">

<REASONS>

<DEFAULTREASON value="Test Passed" />

</REASONS>

<FIELDS>

<FIELD refname="Microsoft.VSTS.Common.ClosedDate">

<SERVERDEFAULT from="clock" />

</FIELD>

<FIELD refname="Microsoft.VSTS.Common.ClosedBy">

<COPY from="currentuser" />

<VALIDUSER />

<REQUIRED />

</FIELD>

<FIELD refname="System.AssignedTo">

<DEFAULT from="currentuser" />

</FIELD>

</FIELDS>

</TRANSITION>

<TRANSITION from="Resolved" to="Active">

<REASONS>

<DEFAULTREASON value="Reactivated" />

</REASONS>

<FIELDS>

<FIELD refname="Microsoft.VSTS.Common.ActivatedBy">

<COPY from="currentuser" />

<VALIDUSER />

<REQUIRED />

</FIELD>

<FIELD refname="Microsoft.VSTS.Common.ActivatedDate">

<SERVERDEFAULT from="clock" />

</FIELD>

</FIELDS>

</TRANSITION>

</TRANSITIONS>

</WORKFLOW>

<GLOBALLIST name="Bug.Reasons.ReadyToTest">

<LISTITEM value="Fixed" />

<LISTITEM value="Duplicate" />

<LISTITEM value="As Designed" />

<LISTITEM value="Test Failed" />

<LISTITEM value="Postponed" />

<LISTITEM value="In Development" />

<LISTITEM value="Won't Do" />

<LISTITEM value="Can't Do" />

<LISTITEM value="Testing" />

<LISTITEM value="Not enough info" />

<LISTITEM value="Can't Reproduce" />

<LISTITEM value="Test Passed" />

</GLOBALLIST>

<GLOBALLIST name="Bug.Reasons.Resolved">

<LISTITEM value="Fixed" />

<LISTITEM value="Duplicate" />

<LISTITEM value="As Designed" />

<LISTITEM value="Postponed" />

<LISTITEM value="Won't Do" />

<LISTITEM value="Can't Do" />

<LISTITEM value="Can't Reproduce" />

</GLOBALLIST>

<GLOBALLIST name="Bug.Reasons.Active">

<LISTITEM value="New" />

<LISTITEM value="Test Failed" />

<LISTITEM value="Assigned" />

</GLOBALLIST>




Robert Kozak
Robert Kozak

This field is read-only until System.State gets changed; once System.State gets changed, reason will be overwritten by DEFAULTREASON rule.

Are you saying that you cannot edit and save a work item which has an obsolete reason?

Thanks,

Alex

Aliaksei Baturytski - MSFT

No, I just added the <ALLOWEXISTINGVALUE> rule to the defintion of System.Reason, like this

<FIELD name="Reason" refname="System.Reason" type="String" reportable="dimension">
<HELPTEXT>The reason why the defect is in the current state.</HELPTEXT>
<ALLOWEXISTINGVALUE />
</FIELD>

Witimport then returns

Error: TF26062: Rule '<ALLOWEXISTINGVALUE />' is not supported for the field 'System.Reason'.

paso
Why do you need to set ALLOWEXISTINGVALUE on the System.Reason field? What is your scenario?
Aliaksei Baturytski - MSFT
We are importing all the defects, features and tasks from our previous tracking system into TFS. The lifecyle behavior was different there (only states, no reason field). So I want to map all 'old lifecycle states to reasons in TFS. New work items in TFS however should follow the TFS-lifecycle (state, reason).
paso

What is the reasoning behind making this field readonly until a state change? In our process there are mulitple values of reasons within a certain state.

For example, in our process,

In Active state for a work item type Suggestion we have New, Reviewing, and Accepted. For Resoloved we have Duplicate, Won't Do, and Implemented. The Dev, or QA needs to be able to change the reason even if they are not changing the state.




Robert Kozak
Robert Kozak

The reason is that the rule defining list of allowed reasons is scoped to a state transition. Once the work item is saved, we lose the information about its previous state (for perf reasons), so we cannot figure out which list of values to use.

Imagine the following situation: your type has 3 states: State A, State B, and State C; for transition State A => State B valid reasons are Reason A-B-1 and Reason A-B-2. For transition State C => State B valid reasons are Reason C-B-1 and Reason C-B-2. Your work item is currently in State B. What are valid reasons for that work item?

Thanks,

Alex

Aliaksei Baturytski - MSFT

Maybe its just my thinking on how this would work. I am not looking at the general viewpoint that you guys might have but a very specific viewpoint.

I don't care what the previous state is. I have a list of allowed values per state. Once in that state I want the user to be able to change the reason within a defined set of reasons for that state.

Using your example:

State A:

<AllowedValues>

New

</AllowedValues>

State B:

<AllowedValues>

A-B-1

A-B-2

</AllowedValues>

State C:

<AllowedValues>

C-B-1

C-B-2

</AllowedValues>

As far as I am concerned the Transition only gives me a defaultvalue and a list of possible choices. I want to be able to change to another reason with in my defined set of reasons without changing the state again. But I can't do this with System.Reason because once it is saved it becomes readonly.

Like I said, maybe its my limited understanding on why this field exists. I ended up making my own that works perfectly fine the way I descibed it.




Robert Kozak
Robert Kozak

System.Reason was designed for explaining why certain transition occured - i.e. someone must have a reason for moving a work item from one state to another, and this reason would be stored in that field. What you want is the reason to be in that state. And it was totally OK that you've added a new field & rules to adjust the work item type for your needs - after all, we were trying to make the type definition customizeable, and our default workflow doesn't fit your needs.

Thanks,

Alex

Aliaksei Baturytski - MSFT

I'm still not completely with you about reasons and states.
As an example I look at the factory definition of a task for the MSF Agile Process.
This has an Active-Closed transition with following reasons: Completed, Deferred, Cut, Obsolete.
I think it's not hard to find a scenario that requires an Active-Closed transition with "Deferred" reason, but at some later moment in time, it is deciced that the task will be cut.
In order to accomplish this, you have to change states twice: from Closed to Active with reason 'Reactived" and then from Active to Closed with reason 'Cut.
This is not very 'performant' for the user.

paso

This is one of the main reasons we hated other bug tracking tools. Too many steps to transition states. At least with TeamSystem we can make our own fields and workflow.

Obviously there must be a large percentage of people out there that are very happy with the way MS has designed the State and Reason fields. We might just be the small minority.




Robert Kozak
Robert Kozak
reply 14

You can use google to search for other answers

 

More Articles

Make a new field depending on "Assigned To"
Customize Query Variables
Assigned To getting blanked out when closing task
Full list of Work Item Field names
has anybody created a conversion tool that import bugzilla bugs a...
How to display Specific Revision of workitem
Work Item - LISTITEM Value to return the same list as VALIDUSER c...
Label Report of work items and files
WIQL Documentation
Problem with filter Changed by on closed work items
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Strange Problem --- SQL Server 2005 and …
Looking for RASK Requirements Authoring.…
Grouping Query Clauses
Getting Associated work item for a chang…
Searching Work item history
Unable to publish new project tasks
Project to TFS error -- garbled screen d…
File Attachment Best Practice
Make a new field depending on "Assi…
WorkItemChangedEvent doesn't retrieve &q…
geting saving error when editing defect?
Publishing to TFS from Project 2003 rese…
Newbie Question - Edit Existing Team Pro…
My Tasks are getting deleted when checki…
MS Project synchronization

Hot Articles

Can't see new work items in Project Portal
How can I restrict permissions to change…
How to track completed workitem
Work Item Attachment
MS Project Mapping Problem
How to Import/Export WorkItems in TFS-RTM
Publishing to TFS from Project 2003 rese…
TF54000: Cannot update data because the …
Way to change the order of "found i…
BUG: MS Project Work Item Publish Error
Removing a work item
Added fields and mapping changes
Reuse Dialog Boxes
MS project problem
TF80070 after updating FieldMapping.xml …

Recommend Articles

Refresh on the TeamFoundationServer obje…
Transition rules
missing Microsoft.TeamFoundation.WorkIte…
Work Item Update Collisions
Customize Query Variables
Unable to publish new project tasks
Q on conditional Rules- how to delete co…
Areas on Scenario
Can't see new work items in Project Portal
WorkItem Class is not marked as serializ…
How to add custom fields that works like…
Set permission to some specific group to…
Can I edit scenarios on Project Portal?
WorkItem Project Alerts not working
Automate "Add solution to Source co…