Skip to main content

Create item

Creates a new test item

Function CreateItem(Val URL, Val Token, Val Project, Val ElementStructure, Val Parent = "") Export

ParameterCLI optionTypeRequiredDescription
URL--urlStringReportPortal server URL
Token--tokenStringAccess token
Project--projStringProject ID
ElementStructure--paramsStructure Of KeyAndValueItem parameters. See GetItemStructure
Parent--parentStringID of the parent item, if necessary
Returns

Map Of KeyAndValue - serialized JSON response from ReportPortal

1C:Enterprise/OneScript code example
URL = "tests.openintegrations.dev";
Token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX25hbWUiOiJzdXBlcmFkbWluIiwic2NvcGVzIjpbInVpIl0sImV4cCI6MTc2MjAwMDI3NiwiaWF0IjoxNzYxOTEzODc2LCJqdGkiOiI0NTI3YTc5OS0wN2...";
LaunchID = "";
Project = "Test";

StartDate = Date("20260101100000");

ElementStructure = New Structure;
ElementStructure.Insert("name" , "Test");
ElementStructure.Insert("startTime" , StartDate);
ElementStructure.Insert("type" , "test");
ElementStructure.Insert("description", "Test launch");
ElementStructure.Insert("launchUuid" , LaunchID);

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

oint rportal CreateItem \
--url "tests.openintegrations.dev" \
--token "***" \
--proj "Test" \
--params "{'name':'Test','startTime':'01/01/2026 10:00:00','type':'test','description':'Test launch','launchUuid':'1b36bda4-c9ba-4fb0-9f6a-5402ddfe5aa6'}"
Result
{
"id": "ad82e5b3-56dc-4176-a462-a434b55caeec",
"uniqueId": "auto:293897e9b3e0f4d39b111586ac4a3985"
}