How to create a pick list which returns a list of Teams to which the Current User belongs

Version 1

    Details

     

    Out of the box there is a Quick Action on Incident called "Assign Incident To Me". 
    This sets the Incident Status to Active and assigns the Incident to the Current User in their default Team. 

    You want to enhance this so: 
    - If the Current User is in 1 team only, set the Team field to be the Current User's Team. 
    - If the Current User is in multiple teams (as seen on the Teams tab on Employee), prompt the user to select the correct Team. 

     


    Resolution

     

    Create a Pick List called, for example, "List of Current Users Teams".

    The Pick List pulls the Team value from StandardUserTeam with the constraint: 
    [Employee#.Rev2]Team In List $(CurrentUserTeamNames())
    AND
    [Employee#.Rev2]RecId Equal To $(CurrentUserRecId())




    Adapt the Quick Action "Assign Incident To Me" as follows: 
    Change:
    Team = $(CurrentUserTeam()) 

    to:

    $(if ChildFold("Employee#", 
         CurrentUserRecId(), 
         "StandardUserTeam#.Rev2", 
         "1", 
         "+") > 1
      then Prompt("Select Team", "List of Current Users Teams")
      else CurrentUserTeam())

    When running the Quick Action, if the Current User is a member of more than 1 Team they are prompted to choose the correct Team.