It's all about the answers!

Ask a question

Potential Workaround: vary attribute read-only by state?


Stephen Hunt (81112) | asked Jul 15 '11, 11:36 a.m.
JAZZ DEVELOPER
Goal: allow an attribute to be read only in some states and editable in others.

Solution Example using a timestamp attribute: Fixed Date.

    1. Create a new attribute, it is not read only. Name = Fixed Date Id = com.ibm.team.workitem.attribute.fixeddate.
    2. Create a new attribute, it is not read only. Name = Internal FD, Id = com.ibm.team.workitem.attribute.internalfd.
    3. Add both fields, next to each other on the Editor Presentation for the WI type.
    a. For the Internal FD attribute, add with Label of Fixed Date.
    b. For the Fixed Date attribute, add with Read Only option True.
    c. For the Fixed Date attribute, click the Hide in Workflow States Edit button and select the states you want the user to be able to directly, i.e. not via plugin automation, change the value of Fixed Date and click OK.
    d. For the Internal FD attribute, click the Hide in Workflow States Edit button and select the states you want the user to not be able to directly change the value of Fixed Date and click OK.
    e. Create Precondition Plugin code that also is aware of the transitions in which Fixed Date is allowed to be changed, in those transitions, update the value of Fixed Date with the value of Internal FD assuming it passes all condition checks.


Other than overloading the project area with two fields instead of one. Will this workaround work? Does anyone see an issue with this approach?

Be the first one to answer this question!


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.