mperrone

We have a business rule that the required fields for new work items need to be readonly when the work item is saved for the first time. I tried using....

<WHENNOT field="System.Rev" value="0">
<READONLY />
</WHENNOT>

..but I get an error when saving the work item



Re: Team Foundation Server - Work Item Tracking Readonly after save

Aliaksei Baturytski - MSFT

I would define READONLY rule on these fields within the initial transition (from the empty state); this would work for sure.

Thanks,

Alex





Re: Team Foundation Server - Work Item Tracking Readonly after save

mperrone

Alex,

This made the field readonly when I select Add Change Request. What we need -- new work items require the Title but once a work item is saved the Title needs to be readonly. Can you supply the XML for the Title field Thanks





Re: Team Foundation Server - Work Item Tracking Readonly after save

Aliaksei Baturytski - MSFT

This can be achieved by using FROZEN rule, which freezes field's value once it's set, and only allows changing it to the empty value. Here's what I would do:

1. Define FROZEN rule at the field definition level.

2. Define REQUIRED rule at the field definition level.

This will guarantee that the value will be set in the first revision and will not be changed afterwards. However, if I remember right, it won't make your field read only. You could try using READONLY rule, however, I don't see a perfect solution for this problem - I do not know how to make the field readonly for the default state, but keep it editable during the initial transition from the empty state.

I hope this helps.

Alex





Re: Team Foundation Server - Work Item Tracking Readonly after save

mperrone

I tried this as well as <cannotlosevalue>. Both clauses allow the user to get around the restriction. The only solution

I could find was to make the fields in question <readonly> if the state is not proposed. Hope this gets addressed in orcas

Thanks for the effort Alex