It's all about the answers!

Ask a question

Can You Lock Modiifcations to a Defect Work Item Based On A State?


Rob Olsen (351143) | asked Apr 24 '17, 4:18 p.m.

So I have a customer with a pretty basic request, although unique.  I am implementing the capability to generate a "Problem Report" (PR) from results in a RQM Test.  "CreatePR" will fall under "Defect" in the drop down list when you select "Create Defect" in the RQM Test Record.  Some of the data will automatically be entered in the PR, other data the user will enter and then select "OK".  At this point a new PR record is created and a link from that RQM Test Record is also created.  The customer now is ok with allowing the user to open this PR record under RTC but he does not want them to be able edit anything.  Once they click "OK" they are locked down.  I tried to do this with "permissions" but was not able to.  I was hoping that I could use a "state" and then make that data "Read Only".  Is there any way to do this? 

One answer



permanent link
Kevin Ramer (4.5k6172191) | answered Apr 24 '17, 4:35 p.m.

RTC Provides 2 operation advisors (pre-conditions, actually) "Read-only Attributes for Condition", "Read-only Attributes for State".   The former requires that Attribute Customization has one or more Conditions defined, the latter one can pick the work item type / state and then choose the attributes to be read-only.

The Condition looks like must be script based which requires JavaScript be written to test for your condition and give yes/no result.

Operation advisors are configured against RTC operation (e.g. Save Work Item, Deliver (server) ) and at least 1 Role.   You'd probably want to align the pre-condition on a role assigned to users that would be in the scenario above and have other roles be able to "exit the loop"

Docs:  https://www.ibm.com/support/knowledgecenter/en/SSYMRC_6.0.2/com.ibm.team.workitem.doc/topics/t_defining_precond_fuactions_web.html

Picked 6.0.2 at random.  I believe these advisors have been around for a couple of versions of RTC now.



Comments
Rob Olsen commented Apr 24 '17, 4:54 p.m.

Perfect, that is exactly what I was looking for.  I have used Pre-conditions for other attribute :Required Properites" and "All Children Resolved" but didn't think to look for this capability there.   Very good, thanks! 


Rob Olsen commented Apr 24 '17, 5:13 p.m.

Well I though this would resolve it, but after setting that "Precondition" it makes it read-only even in the "Initialize" state.  After reading about "Read-Only Attributes for Type and State" it sets it to "read-only" even if the state that I selected is not the current state.  The Description reads "Verifies that a work item that matches the selected types or states can be saved only if the selected attributes are unchanged."  The word "or" got me.  So on my first state is "Initialize" and the attribute is set to read only.  So that doesn't work either.   I need it to be set as "read-only" when it gets to a certain state. 

Your answer


Register or to post your answer.