Skip to content

Function: createUser() ​

ts
function createUser(
   client, 
   parameters, 
   options?
): Promise<{
[key: string]: unknown;
  accountId?: string;
  accountType?: "unknown" | string & object | "atlassian" | "app" | "customer";
  active?: boolean;
  applicationRoles?: {
   [key: string]: unknown;
     callback?: {
      [key: string]: unknown;
     };
     items?: object[];
     max-results?: number;
     pagingCallback?: {
      [key: string]: unknown;
     };
     size?: number;
  };
  appType?: string;
  avatarUrls?: {
   [key: string]: unknown;
     16x16?: string;
     24x24?: string;
     32x32?: string;
     48x48?: string;
  };
  displayName?: string;
  emailAddress?: string;
  expand?: string;
  groups?: {
   [key: string]: unknown;
     callback?: {
      [key: string]: unknown;
     };
     items?: object[];
     max-results?: number;
     pagingCallback?: {
      [key: string]: unknown;
     };
     size?: number;
  };
  guest?: boolean;
  locale?: string;
  self?: string;
  timeZone?: string;
}>;

Defined in: src/cloud/api/users.ts:57

Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is available this resource will be deprecated.

Note: This API does not support Forge apps.

If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have access to Jira & no new jira-products are requested, the operation returns a 400 status.

Permissions required:Administer Jira global permission. The caller has to be an organization admin.

Parameters ​

ParameterTypeDescription
clientClient-
parameters{ emailAddress: string; products: string[]; self?: string; }-
parameters.emailAddressstringThe email address for the user.
parameters.products?string[]Products the new user has access to. Valid products are: jira-core, jira-servicedesk, jira-product-discovery, jira-software. To create a user without product access, set this field to be an empty array.
parameters.self?stringThe URL of the user.
options?RequestOptions-

Returns ​

Promise<{ [key: string]: unknown; accountId?: string; accountType?: "unknown" | string & object | "atlassian" | "app" | "customer"; active?: boolean; applicationRoles?: { [key: string]: unknown; callback?: { [key: string]: unknown; }; items?: object[]; max-results?: number; pagingCallback?: { [key: string]: unknown; }; size?: number; }; appType?: string; avatarUrls?: { [key: string]: unknown; 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; expand?: string; groups?: { [key: string]: unknown; callback?: { [key: string]: unknown; }; items?: object[]; max-results?: number; pagingCallback?: { [key: string]: unknown; }; size?: number; }; guest?: boolean; locale?: string; self?: string; timeZone?: string; }>