Precondition "Read-Only Attributes for Type and State" and Team Areas
- modification of a work item in the initial state
- creation of a new work item
Accepted answer
I found and modified the code for the advisor to create a new setting for the create case.
I did not update the UI.
it was really the nothing -> new state transition save (create)
vs the new -> still new save
Comments
I added config thru the process config XML for the nothing->new case.. see the answer below, as I can't paste that much into a comment
here is the process xml for my advisor.. it IS the same as the product provided one, except I added the extra keyword, onCreate
so the product version is used for all the normal settings and our was used for just the create case.
<precondition description="required properties only during create" id="com.xx.extensions.advisor.requiredProperties" name="xx Required Properties Advisor">
<workflowProperties onCreate="true" stateId="s1" workItemType="defect">
<property id="com.ibm.team.workitem.attribute.severity"/>
<property id="com.ibm.team.workitem.attribute.version"/>
<property id="com.xx.id.workitem.attribute.feature"/>
<property id="com.xx.tools.workitem.attribute.detectedbygroup"/>
</workflowProperties>
</precondition>
One other answer
It will not update the UI with this information, if you want that, please read the section in https://rsjazz.wordpress.com/2015/08/07/a-custom-condition-to-make-attributes-required-or-read-only-by-role-version-2/ that discusses how that actually works.
You can use https://rsjazz.wordpress.com/2015/08/07/a-custom-condition-to-make-attributes-required-or-read-only-by-role-version-2/ or its predecessor, customize it for your purposes and use that, if you want the UI to show the read only information.
A custom pre condition/advisor is easier to maintain but it does not give the UI clue. A condition would require to maintain settings if you add attributes.