How do I make a work item attribute/field only visible upon the specific selection of another attribute's choice?
Hello,
I am currently running Jazz Team Server v6.0.3, with intentions to upgrade to v6.0.6.1 .
I have a new business requirement and need to implement a custom created attribute called "Estimated Completion Date:" which is only visible upon the selection of a specific Team from the out of the box attribute "Filed Against:" choices.
Use case example:
If I create a work item and select the "Data" Team from the "Filed Against:" dropdown's choices, the custom attribute/field "Estimated Completion Date:" becomes visible and a date can be selected. If I select any other Team from the "Filed Against:" dropdown's choices, the "Estimated Completion Date:" attribute/field is not visible/becomes hidden. For reference if needed, the 'Estimated Completion Date' attribute type = Timestamp, and the 'Filed Against' type = Category.
I have read that there is Work Item Customization with JavaScript that could possibly give me this ability/feature. Would anyone know how to implement this with JavaScript?
Thank you for any help.
Mark
Mark
3 answers
There is a school of thought in uX design that says in this situation it's better not to hide and show individual fields and instead to make them read only. That's a very simple option that can be done out of the box.
Is there a reason you need the data to actually be hidden for some teams and not others?
Comments
As far as I am aware there are no fancy ways allowing to hide attribute presentations. It is only possible to hide attributes based on the configuration options in the editor presentation. I am not aware of a dynamic way and there is also no API that I would be aware of.
In addition to all that, hiding the attributes in the editor presentation would not hide it in
- Query results
- Reports
- Plans
In RTC you can hide or show an attribute on a form based on the presence of a link on the work item.
This is the rule: attributeA can be configured to show on the form only if the work item has at least one link of certain type (say, linkA)
With RTC 6.0.3 I had once your same need, and I achieved this goal by defining a set of custom link types (one for each "Filed Against" category).
Then I developed a follow-up action (triggered by work item save) that creates automatically on the work item a link of the type corresponding to the category.
When another category is selected, the old link is removed and a new one is created.
Anyway, you cannot implement this solution with JavaScript, you need server-side Java API.