Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Precondition "Read-Only Attributes for Type and State" and Team Areas

We want that "Everyone" role should be able to comment on any work item. No other attributes should be allowed to be changed by Everyone role. We used precondition "Read-Only Attributes for Type and State" to configure the Everyone role accordingly: All work item attributes are configured as Read-Only except Comments.

This works fine as long was we don't use Team Areas. But if Users are only added to a Team Area, but not to the Project Area, users will not be able to create work items anymore even if they have the required roles configured in the Team Area. A user that creates a new work item gets Everyone role until he sets the "Category" and saves the work item. But due to the configuration of the Everyone role he is not allowed to set Category, Summary, ...

The problem is, that in the configuration of "Read-Only Attributes for Type and State" it is not possible to differentiate between the cases
  • modification of a work item in the initial state
  • creation of a new work item

How can we implement such a requirement? We don't want to additionally configure users and roles in the Project Area. We also don't want Everyone role to modify work items in their initial states - except for adding additional Comments.

0 votes


Accepted answer

Permanent link
we had a similar problem with new (on create) and new (after create).

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
Stefan Oblinger selected this answer as the correct answer

0 votes

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

Permanent link
https://rsjazz.wordpress.com/2015/08/07/a-custom-condition-to-make-attributes-required-or-read-only-by-role-version-2/ shows code that is derived from the internal code. You notice that it calculates the state in the condition and it is only interested in the target state. The target state for a work item is created is New. So as Sam said, you could basically steal the existing code and create a new advisor that prevents saving by your rules.

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.

0 votes

Comments

 Thanks Sam and Ralph

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Dec 09 '15, 11:57 a.m.

Question was seen: 3,058 times

Last updated: Dec 11 '15, 10:05 p.m.

Confirmation Cancel Confirm