It's all about the answers!

Ask a question

RTC - Best Way to implement the dependent scenario


V Niranjan (12534567) | asked Feb 27 '14, 4:08 a.m.
Hi

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

Comments
Ralph Schoon commented Feb 28 '14, 2:15 a.m. | edited Feb 28 '14, 2:15 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

What are the rules to choose the Owner of the work item?


Dinesh Kumar B commented Feb 28 '14, 2:44 a.m.
JAZZ DEVELOPER

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....

Accepted answer


permanent link
Aradhya K (1.4k44345) | answered Feb 28 '14, 3:08 a.m.
JAZZ DEVELOPER
If I understand the problem correctly, you want to restrict the list of users shown in the owner selection drop down.
Restricting the list of Owners is only done based on the Team Area the work item is filed against. 
I would suggest creating a category called "Raised by Client" and associate this with the team of people working on the client defect. This way the set of users available to select as owners will be restricted.
V Niranjan selected this answer as the correct answer

3 other answers



permanent link
Ralph Schoon (58.0k23642) | answered Feb 28 '14, 3:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Dependent enumerations only work on enumerations. So they are out of the picture.
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.





permanent link
V Niranjan (12534567) | answered Feb 28 '14, 3:23 a.m.

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
Ralph Schoon commented Feb 28 '14, 5:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


permanent link
Vaibhav Srivastava (2861) | answered Feb 28 '14, 4:57 a.m.
JAZZ DEVELOPER
 Hey Niranjan
This is an elaborate article on dependencies and how to setup, maybe this will help
https://jazz.net/library/article/821
Also an example
Hope this helps
Vaibhav

Your answer


Register or to post your answer.