Required attributes/attributes must have specific values on state transition
Lewis Tsao (217●49●63)
| asked Apr 05 '13, 6:01 a.m.
edited Apr 05 '13, 6:19 a.m. by Ralph Schoon (63.6k●3●36●46)
Hi,
Not sure if something similar has been asked before. Let's say I on a work item transition from stateA -> stateB, certain attributes are required and/or must have certain value. While it is in stateA, the attributes may or may not be set. But they must be set on transition. So stateA -> (precondition attribute set/specific value) action -> stateB stateA -> action (precondition...) -> stateB in stateA attr values don't care in stateB attr values must be set/correct value transition not permitted unless attr values must be set/correct value can this be done (without Java/relatively easily)? Thanks |
Accepted answer
Ralph Schoon (63.6k●3●36●46)
| answered Apr 05 '13, 6:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Apr 05 '13, 6:20 a.m.
Levis, how that works with RTC is as follows.
You can configure required attributes in the Eclipse UI in the operation behavior section for the work item save operation. You can specify which attributes for which work items are required in which state. If a state change is selected the save will fail if these are not set. You can use JavaScript attribute customization - validations - see https://jazz.net/wiki/bin/view/Main/AttributeCustomization and https://jazz.net/library/article/1093 to make sure that only certain values are valid to be saved in a specific state. However, the way JavaScript gets triggered it is currently not easily possible to detect a state change. So you would be probably able to have an attribute validation that looks at the current state and at an attribute value and select it invalid in this state, but you can not prevent a state change when the attribute value is valid in the current but not in the target state. To achieve the latter, you would have to create a custom advisor / precondition, similar to the follow up action developed here: https://jazz.net/library/article/1000 . You can find additional information about advisors here: https://jazz.net/library/article/495 and hints about the API here in my blog. Lewis Tsao selected this answer as the correct answer
Comments
Lewis Tsao
commented Apr 05 '13, 6:41 a.m.
Many thanks Ralph.
Lewis, I think you should not have different valid values of attribute in different states - except more choices.
|
One other answer
Many thanks Ralph.
Any chance of putting this in as an enhancement request. I have been to various customers who have requested this. I suppose it is possible to work round this by having an "approver" who will only approve the WI when all "answers" are correct. But this can become tedious for the approver if there are lots of WI. |
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.