RTC - Best Way to implement the dependent scenario
I have the following scenario. I would like to know what is the best way to implement this in RTC 4.0.3
1) For the Defect Work Item Type I have a mandatory field called "Defect Category" which is a enumeration and has two values
Raised by Project and
Raised by Client
2) If the option selected is "Raised by Project" then the appropriate values should be selected in the Owned By field
3) If the option selected is "Raised by Client" then the appropriate values should be selected in the Owned By field
In the attribute customization the Dependent Enumeration Value Set takes only Enumeration.
Please let me know.
Regards
Niranjan V
Accepted answer
3 other answers
Make clearer what "Selected" means. The dependent enumeration only limits the available choices for enumeration values, it does not set a value on its own and it does not necessarily limit to one choice either, if I recall correctly.
I assume the choice is not just between two users, so there must be some logic e.g. role based. We need to better understand what that logic is.
Without additional information, there are basically these possible solutions I see.
1. A custom work item save Advisor that blocks on a wrong choice. Con: it would not limit the choice. Pro: easy deployment and works for all clients.
2. A Java based Attribute customization could be possible, but Dinesh's concern is correct, It can detect the work item type and provide a value set for one type, but it would have to be able to work for all work item types. I am also concerned about its capability to work with the special user picker that is built in. Basically this would have to be tried. Pro: limited selection. Con: works only for Web UI and Eclipse UI. Required to be deployed on Eclipse and the server.
Java Script based attribute customization is probably out of the picture due to the limitations of JavaScript with respect to accessing the users/contributors.
Based on the business logic there might be other possible approaches, however I would probably go for the 1st approach, as it is the least invasive one.
Hi All
By Selected I mean the drop down must show the list of appropriate values and one is selected.
So If I select the option Raised by Project then the appropriate users with a specific role should be listed and I can select one of them.
Dependent enumeration does not work here.
Regards
Niranjan V
Comments
Hi,
I am not sure if the role based user list attribute customization can be called in java-script. Probably not. In this case you would have to create your own "custom role based user list" attribute customization in Java. You would have to wrap the existing role based user list into Java code that provides the desired roles for the type you want and all users, for other types (see Dinesh's comment for why). See https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ for examples and some discussion around the API.
Another approach would be a validator (Java) that blocks save and provides the knowledge who to select) .
Arydha's approach is what RTC provides out of the box, but not role based, unfortunately.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Feb 28 '14, 2:15 a.m.What are the rules to choose the Owner of the work item?
Dinesh Kumar B
JAZZ DEVELOPER Feb 28 '14, 2:44 a.m.can i confirm if based on Defect Category
a. the Owned By field will have ONE appropriate value selected
or
b. the Owned By field will show appropriate values that would be selectable
also, since we are looking at Owned By which is a built-in attribute, any attribute customization applied to it would reflect in all the work item types and extra caution might be required here....