It's all about the answers!

Ask a question

Work Item editability restrictions based on State and Roles


Tony Rajan (1114) | asked Oct 15 '15, 7:13 a.m.
How can I restrict a workitem's editability based on state change and only a set roles wont be allowed to edit it.

E.g. A workitem moves from Unassigned to submit state the "team members" loses editability once it moves to submit however the "Team Owners" will have access to modify the item to move it to further states.

Any help on how to go about it ?

Accepted answer


permanent link
sam detweiler (12.5k6195201) | answered Oct 15 '15, 7:30 a.m.
there is no way to do this out of the box. you could write a java server side extension that could implement the logic you describe.

see the extensions workshop to get started on learning how to build one of these.
https://jazz.net/library/article/1000

the server side apis are not documented, but Ralph has a great blog that has lots of samples
https://rsjazz.wordpress.com/
Tony Rajan selected this answer as the correct answer

Comments
Tony Rajan commented Oct 15 '15, 8:47 a.m.

Sam, thanks for the https://rsjazz.wordpress.com/
this is what we were looking for 

Solution Summary

The condition, lets call it User Role for Type and State Condition is a Java based extension for the Eclipse client and the RTC server. It allows configuring roles mapped to work item type categories and states.
The condition checks if the current work items category and state has roles configured. If roles are found, and the user has any of the roles, the condition returns true, false otherwise.
This condition can be configured and be used to make work item attributes read-only or required for a work item type category in a specific state based on the roles a user has in this context.

But alas :(

The code can be downloaded from DropBox here. "Please note, there might be restrictions to access DropBox and the code in your company or download location."


Ralph Schoon commented Oct 15 '15, 8:55 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If your company or your country blocks DropBox, there is nothing I can really do about. Try it at home.

One other answer



permanent link
Arun K Sriramaiah (3.2k23677) | answered Oct 15 '15, 7:33 a.m.
Hi  Tony,

Please find the links below it will help you.

https://jazz.net/forum/questions/134801/type-and-role-based-and-state-based-work-item-attribute-change-permissions

https://jazz.net/forum/questions/79903/read-only-work-item-attributes-based-on-role-and-attribute

Regards,
Arun.

Comments
Tony Rajan commented Oct 15 '15, 8:42 a.m. | edited Oct 15 '15, 8:44 a.m.

Arun thanks for pitiching in but we are not looking for just non-editability of attributes in a state by role but the entire workitem as a whole.


Ralph Schoon commented Oct 15 '15, 8:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The question remains, how the user should know that the work item is not editable. with just a custom advisor he won't. Carefully read https://rsjazz.wordpress.com/2015/08/07/a-custom-condition-to-make-attributes-required-or-read-only-by-role-version-2/ and the reasoning.

If you don't use a condition to make the attributes read only, the user will basically think they can change the work item attributes and be surprised and annoyed when pressing save. So would I .

Don't make the state read only using that condition, the condition looks at the current state and the workflow action and the state calculated from that is basically what it uses as context for its work.




Ralph Schoon commented Oct 15 '15, 9:09 a.m. | edited Oct 15 '15, 9:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

And keep in mind that you can also use role based permissions to allow or deny changing of attributes as well as prevent state changes. In this case the user gets a notification in the UI as well, as far as I know. See

  Lab 3 to 5 for more information.

Your answer


Register or 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.