Shell.User Attributes

Is there a way to get group membership via AppScript using Shell.User?

I'm trying to determine if a user belongs to a specific group, and if so execute logic to update a specific tracking field.

I tried searching in help but could not find the Shell.User attributes.

Thanks in advance.

  • Okay based on my research it looks like there may not be a method to pull group membership of Shell.User....

    My other option is that I could compare the current user (Shell.User.GetDisplayName) to a list field (which is based on the role that the group I need to determine if the user belongs to is assigned to).

    My question can I pull in a full list field and push it into an array somehow then loop through to see if the current user matches any of the users in the list?

  • Basically we have named users that are both clients and internal users, but we want to track when the internal users update the work notes (client facing field) and record that date.

    in Teamtrack both the username and the date were part of the work notes so I could parse them out and compare the parsed username to Shell.User.GetDisplayName if it matched the logged in user update the tracking field with the date that I parsed out - this ran only on the internal user's transitions so it never ran for client named users.

    with SBM - the work notes show the work notes as follows "[Picture] [User display name] - [date] [time] ..." The problem is in my parsing I've discovered that the "actual field" starts at "[date] [time]" and the username is not part of the field itself... so I have nothing to compare Shell.User to unless I compare it to group assignment, roll assignment, or field listing (based on role

  • That is VERY similar to what I'm trying to do, the only difference would be the criteria that you require versus mine. In thinking more about this I'm not sure how I would verify that the current user was the one to update the worknotes, now that the username is not contained in the worknotes field...

    I'm thinking I might have to get convoluted here and run a form action to determine if worknotes change, if so kick off an appscript and match the current user to the last modifier and then update the tracking field... this form action would be run on only transitions for internal staff.

  • Shell.User is just a User object. User inherits from UGBase, which has a Member method. I believe that will help you out.

  • What would happen if you always updated the worknotes with the date/time, no matter who did it?

  • Lynn,

    Can you expand on the UGBase method? I searched through the API documentation but I was unable to find any information about this method. We're basically attempting to set a single selection field based on a submitter's group membership.

    -John Wermers

  • John: UGBase is the "parent" class of the "User" class. On page 79 of the SBMS_SCRIPT_GUIDE.PDF the "User" class definition shows:

    AppRecord --> UGBase --> User

    Which means that a User object is a UGBase object which is an AppRecord object. A User object (like Shell.User) can call the UGBase method "Member". Example:

    If Shell.User.Member(123) Then

    ' The current user is in SBM group with ts_id 123


    ' The current user is not in that SBM group.

    End If

  • The idea behind my script is to track when a technician last updated the ticket; versus an internal employee or a Client.

    So that would essentially become the last modified date.

  • What if you have a "technician update" and an "everyone else update". The "technician update" is restricted to members of the "Technicians" group and it over-rides the date/time to "Now". The "everyone else update" is not available to Technicians but is available to everyone else. Both could be called "Update", but you'll get warnings about duplicate names. No scripting required.