Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning

The availability of the users personal data may be impacted by the recent changes by Atlassian in order to meet GDPR compliance. See the following for more information:

  • This routine is available starting with katl-commons 1.0.
  • This routine is available for Jira server and cloud deployment options.
    Info
    titleAvailability
    Table plus
    applyColStyleToCelltrue
    heading0
    columnTypess,s,s,s
    multiplefalse
    columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
    enableSortingfalse

    Syntax

    userInGroup(group, user)

    Package

    Alias

    Pkg Usage

    Description

    Excerpt
    hiddentrue
    Verifies if the selected user is in the selected group(s).

    Verifies if the selected user is in the selected group(s).

    Parameters

    Table plus
    applyColStyleToCelltrue
    columnTypess,s,s,s
    heading0
    multiplefalse
    enableSortingfalse

    Parameter name

    Type

    Required

    Description

    group

    string / string[]

    Yes

    Name(s) of the group(s) the user should belong to.

    user

    ...

    String

    Yes

    Name or key of the user that needs to be verified.

    ...

    It searches by the user key first and if there is no result

    ...

    by the user name as well

    ...

    .

    Return

    ...

    boolean (true/false)

    ...

    Type

    Boolean

    A "true" return value means that the user associated with the specified username or userkey belongs to the given group(s).

    ...

    Examples

    Example 1

    ...

    Code Block
    userInGroup("Administrators", "Admin1");
    

    Returns Returns "true" if Admin1 is included in Administrators group and and "false" if Admin1 is not included in Administrators group.

    Example 2

    ...

    Code Block
    userInGroup("Administrators", "557058:950f9f5b-3d6d-4e1d-954a-21367ae9ac75");
    

    ...

    "

    ...

    Example 3

    Code Block
    userInGroup("Users", currentUser());
    

    Returns: True if the current user is included in "Users" group or False if the current user is not included in "Users" group.

    Example

    ...

    3

    Code Block
    string[] groups = {"Administrators", "Users"};
    userInGroup(groups, currentUser());
    

    Returns Returns "true" if the current user is included in Users in Users or Administrators  Administrators group and and "false" if the current user is not included neither in Users nor in Administrators group.

    ...

    Users nor in Administrators group.

    Note

    ...

    The look -up is first made after the userkey, then after the username.

    ...

    See also

    Filter by label (Content by label)
    showLabelsfalse
    max25
    showSpacefalse
    cqllabel = "jirauser_group_routine" and space = currentSpace ( )
    labelsjiraarray_group_routineroutines