Skip to main content

Create user

Creates a new user

Function CreateUser(Val URL, Val Token, Val UserStructure) Export

ParameterCLI optionTypeRequiredDescription
URL--urlStringReportPortal server URL
Token--tokenStringAccess token
UserStructure--paramsStructure Of KeyAndValueNew user data. See. GetUserFieldsStructure
Returns

Map Of KeyAndValue - serialized JSON response from ReportPortal

1C:Enterprise/OneScript code example
URL = "tests.openintegrations.dev";
Token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX25hbWUiOiJzdXBlcmFkbWluIiwic2NvcGVzIjpbInVpIl0sImV4cCI6MTc2MjAwMDI3NiwiaWF0IjoxNzYxOTEzODc2LCJqdGkiOiI0NTI3YTc5OS0wN2...";
Name = "testproject";

UserStructure = New Structure;
UserStructure.Insert("active" , True);
UserStructure.Insert("login" , "test");
UserStructure.Insert("password" , "G00d_Pass");
UserStructure.Insert("fullName" , "Test User");
UserStructure.Insert("email" , "test@example.com");
UserStructure.Insert("accountRole" , "USER");
UserStructure.Insert("projectRole" , "MEMBER");
UserStructure.Insert("defaultProject", "test");

Result = OPI_ReportPortal.CreateUser(URL, Token, UserStructure);
# JSON data can also be passed as a path to a .json file

oint rportal CreateUser \
--url "tests.openintegrations.dev" \
--token "***" \
--params "{'active':true,'login':'test','password':'***','fullName':'Test User','email':'test@example.com','accountRole':'USER','projectRole':'MEMBER','defaultProject':'test'}"
Result
{
"id": 79,
"uuid": "0f0fac7a-f9a8-4f23-8bcb-b2a357b09092",
"login": "test",
"email": "test@example.com",
"fullName": "Test User",
"accountRole": "USER",
"accountType": "INTERNAL",
"active": true
}