We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You must opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> Support Web>ListingGroupMembers (02 Dec 2007, PeterThoeny)
Tags:
create new tag
, view all tags

Question

I have been trying to figure out a way to get variable expansion to return a list in table form of all members (preferably users, but users and groups would do) of a given group. The closest idea I've had is to use a FormattedSearch to extract the

Set GROUP = ...

line from the group topic, and then use regexps to extract the comma-separated group members from that, but it doesn't look like this type of extraction is supported.

Another approach might have been to use = to extract the =GROUP variable from the group topic, but == only lets you extract TWikiPreferences. So how do I do it?

  • TWiki version: 20020803beta
  • Web server: Apache 1.3.23
  • Server OS: RedHat? Advanced Server 2.1
  • Web browser: Mozilla 1.1 alpha
  • Client OS: Linux 2.4.9

-- AdamSpiers - 14 Oct 2002

Answer

You currently cannot get the expanded list of users in case the group includes other groups. However, you can get the list. Example:

%INCLUDE{ "%MAINWEB%.TWikiAdminGroup" pattern=".*\s\*\sSet\sGROUP\s*=\s*([^\n\r]*).*" }%

returns this:

PeterThoeny, Main.SopanShewale

You could do the same with a formatted search and a regular expression, but this is slower.

-- PeterThoeny - 14 Oct 2002

Thanks ... but I actually wanted the list in table form, one user/group per row. Then the AssignedTo column of my primitive bug tracker could have its values restricted to members of a particular group, which is exactly what I need. Is that possible?

-- AdamSpiers - 15 Oct 2002

You are asking for some kind of processing of a comma delimited list into another format like a table. This is currently not possible unless you write a Plugin that does this for you.

<brainstorming>
A ConvertListPlugin? would convert:
%CONVERTLIST{ "A, B, C" into="|$item|" separator="$n" }%
into:

A
B
C
</brainstorming>

Or, you simply could define a preference variable containing your group in table format. But that means you would need to maintain the group in two places.

-- PeterThoeny - 15 Oct 2002

I'm in exactly the same spot - would like to have group members available for selection in an 'assign to' field in the Bugs Contrib Twiki application. Was wondering whether in the passing 5 years anything changed regarding this issue?

-- EyalTeutsch - 01 Oct 2007

Yes, put a %SEARCH{}% in the assigned to field. Make sure to generate a comma-space separated list using format="$web.$topic" separator=", " parameters.

-- PeterThoeny - 02 Dec 2007

 
Topic revision: r6 - 02 Dec 2007 - 09:29:52 - PeterThoeny
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback