I have something that does what your looking for, except it uses
custom fields, but figure it might give you some help:
<<forEachTiddler where 'tiddler.tags.contains("Training") &&
store.getValue(tiddler,"assignedto") &&
(store.getValue(tiddler,"assignedto").readBracketedList().contains(store.getValue(context.inTiddler,"searchfield")))'
sortBy
'store.getValue(tiddler,"traindate")'
write '"|"+store.getValue(tiddler,"assignedto")
+"|"+store.getValue(tiddler,"traindate")+" |[["+tiddler.title+"]]|\n"'
>>
Then I have this in my EditTemplate:
<div macro="showWhen tiddler.tags.contains('search')">
<br />
<strong>Look for: </strong> <span macro='edit searchfield'> </
span>
<br />
</div>
and this in my ViewTemplate:
<div macro="showWhen tiddler.tags.contains('search')">
<br />
<strong>Look for: </strong> <span macro='view searchfield'> </span>
<br />
</div>
It allows me to find all tiddlers tagged 'Training' that have the same
name in the 'assignedto' field as I put in this tiddlers custom
'search' field.
Ken Girard