It's all about the answers!

Ask a question

Checking if particular field in Work Item is edited or not?


Sarthak Sharma (4711620) | asked Oct 26 '12, 6:10 a.m.
Hi,

My requirement is to allow a person with particular role say "Project Manager" to edit particular field say "estimate" in work item and If the person saving the workitem has different role then stop it.

The approach what I think is,

1.) Getting the old value of the "estimate" field and comparing it with the value after "Save" is performed.
Or Putting some Listener for that field (if available) to detect the change.

2.) Check the role of person who has logged in RTC and who is saving the workitem.Compare it with "Project Manager ID" and proceed with rest of the logic.

So, There are two things which I want to ask.

1.) One is , How to detect the change in a particular field in workitem.

In precondition can it be checked OR I have to use workitem history for getting that?
What is the best option for doing it?

2.) How can I know the roles of the person who is saving the workitem?
 

Accepted answer


permanent link
Dinesh Kumar B (4.1k413) | answered Oct 26 '12, 8:24 a.m.
JAZZ DEVELOPER
If I understood rightly, the requirement is to control editing of a specific attribute based on the role associated with an user.  This is possible directly by using OOTB permissions associated with the specific role.

create a specific role which has permissions to edit attribute
assign this role to all users who should have the capability to edit the attribute.

additionally, verify that other roles do not allow editing of the attribute

for this you may want to look at :
Project Area opened in the Eclipse Client > Process Configuration > Team Configuration Permissions > Select a specific Role
From Permitted Actions > Work Items > Save Work Item > Modify the work item > Modify the work item's estimate

hope it helps



Sarthak Sharma selected this answer as the correct answer

Comments
Sarthak Sharma commented Oct 30 '12, 5:42 a.m.

In addition to it, Suppose if a particular user doesn't have permission to save a particular field and we want this workitem to go for approval(to the approvers defined in the work item) before it is reflected. Is that possible ?

5 other answers



permanent link
Dinesh Kumar B (4.1k413) | answered Nov 28 '12, 6:22 a.m.
JAZZ DEVELOPER
can you expand on what it means when you say "before it is reflected?" sorry about my ignorance if its something obvious..

PS: you can reach an user by using @userid, like you tried to and the userid can be known by hovering over the user name and user id appears at the very end of the url... for eg. https://jazz.net/forum/users/din, using this url @<bold part> will take you to the respective user.

permanent link
Sarthak Sharma (4711620) | answered Oct 30 '12, 5:40 a.m.
@Dinesh , One more thing, Suppose if a particular user doesn't have permission to save a particular field and we want this workitem to go for approval(to the approvers defined in the work item) before it is reflected. Is that possible ?

permanent link
Sarthak Sharma (4711620) | answered Oct 26 '12, 9:35 a.m.
You understood it correctly and it is very simple solution.
Thanks Dinesh.

permanent link
Sarthak Sharma (4711620) | answered Oct 26 '12, 7:38 a.m.
Is this applicable for RTC 3.0.1.2 also?

Comments
Lauren Hayward Schaefer commented Oct 26 '12, 7:42 a.m.
JAZZ DEVELOPER

According to the article, this functionality was added in 4.0.


permanent link
Lauren Hayward Schaefer (3.3k11727) | answered Oct 26 '12, 6:54 a.m.
JAZZ DEVELOPER
Hi Sarthak,
The easiest option would probably be to use Preconditions for saving a work item.  https://jazz.net/library/article/997/#dynamic walks you through the steps.  What you will likely want to do is configure a Precondition of "Read-Only Attributes for Type and State" for every role type except Product Manager.  Set the precondition for every state of the work item type.

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.