Values: refer, extend do not work for selectDiscoveries, but a value of "count" works.
All these values work well for very similar method host.get
Reason:
In a revision 16195 (merge of ZBXNEXT-588) the parameter selectDiscoveries to sub-select in a method host.get has been changed to use a method discoveryrule.get (which works well) instead of item.get (doesn't work as described above)
Unfortunately the same was not done for the method template.get
Fix:
Apply attached patch, which use discoveryrule.get as was done for host.get. Patch tested for refer, extend, count values for selectDiscoveries