---
title: "addUserToGroup"
canonical: "https://support.appfire.com/space/PSCONF/15304603/addUserToGroup"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | addUserToGroup(userNameOrKey, groupName) | **Package** |  |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Adds a single user to a group if the user is not in that group already.

Adds a single user to a group if the user is not in that group already.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | userNameOrKey | String | Yes | User name or key of a user to add into a group. |
> | groupName | String | Yes | Name of a group to add user into. |

## Return Type

**Boolean (true/false)**

## Example

```javascript
addUserToGroup("jdoe", "confluence-users");
```

## See also

> Macro (contentbylabel)