Possible to enforce subcategory selection?
We are using RTC Version 5.0.2, and "Filed Against" is a mandatory attribute.
Picture the following scenario: root(unassigned) ->ParentCat ->ChildCat1 ->ChildCat2 Is it possible to enforce selection of one of the Child Categories here? I know not allowing selection of the parent category defeats the purpose of having the parent category at all but it would make life easier :) |
One answer
It should be quite easy to do with a validator (attribute customization). Just read the value of the attribute and test with the two child categories, and return true or false accordingly.
Comments 1
JavaScript: How would you test for the category to be a leaf or not? The only information you have is the label and the value and no API to look into the category tree.
Sian O'Briain
commented Apr 15 '16, 4:46 a.m.
Thanks Ralph. Since it is only a single node category that I am concerned with, would the javascript work with a hardcoded label check?
I think you have to try out what you get for workItem.getLabel(
Sian O'Briain
commented Apr 15 '16, 11:25 a.m.
yay I got it working with a validation script:
Sian O'Briain
commented Apr 15 '16, 3:41 p.m.
For a more general case of blocking all category nodes - the getLabel function returns a string with three spaces pre-pended per level (e.g. subCat1 has three spaces before the title, subCat2 has 6 spaces before the title). However of course this would only be relevant / useful if you have just 2 levels of categories
Sian O'Briain
commented Apr 15 '16, 3:43 p.m.
example:
showing 5 of 6
show 1 more comments
|
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.