Polarion 0.2.0

dotnet add package Polarion --version 0.2.0
                    
NuGet\Install-Package Polarion -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Polarion" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Polarion" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Polarion" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Polarion --version 0.2.0
                    
#r "nuget: Polarion, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Polarion&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Polarion&version=0.2.0
                    
Install as a Cake Tool

PolarionApiClient

A .NET client library for accessing Polarion Requirements Management System via SOAP API.

Installation

dotnet add package Polarion

Usage

Creating the Client

var config = new PolarionClientConfiguration
{
    ServerUrl = "https://your-polarion-server",
    Username = "your-username",
    Password = "your-password",
    ProjectId = "YourProject",
    TimeoutSeconds = 60
};

var polarionClient = await PolarionClient.CreateAsync(config);

Working with Work Items

// Get a specific work item
var workItemResult = await polarionClient.GetWorkItemByIdAsync("REQ-123");
if (workItemResult.IsSuccess)
{
    var workItem = workItemResult.Value;
    // Work with the item
}

// Query work items with specific fields
var query = "type:requirement AND status:approved";
var fields = new List<string> { "id", "title", "status", "customFields.myCustomField" };
var searchResult = await polarionClient.SearchWorkitem(query, "Created", fields);

// Query work items in a baseline
var baselineResult = await polarionClient.SearchWorkitemInBaseline(
    "myBaseline", 
    "type:requirement", 
    "Created"
);

Working with Documents

// Get all documents in a space
var documentsResult = await polarionClient.GetDocumentsInSpace("MySpace");
if (documentsResult.IsSuccess)
{
    foreach (var document in documentsResult.Value)
    {
        // Work with document
    }
}

Features

  • Access Polarion work items via SOAP API
  • Query work items with Lucene query language
  • Support for baseline queries
  • Document/Module access capabilities
  • Custom field support
  • Strongly-typed models
  • Trimmable for size-optimized applications
  • Automatic session management
  • Secure cookie handling
  • Configurable timeouts

Query Examples

Basic Queries

// Search for approved requirements
"type:requirement AND status:approved"

// Search for items modified in last week
"updated:[NOW-7DAYS TO NOW]"

Using Custom Fields

When retrieving custom fields, use the following syntax in the field_list:

var fields = new List<string> { "customFields.myCustomField" };

Error Handling

The client uses a Result pattern for error handling. All operations return a Result<T> that can be checked for success:

var result = await polarionClient.GetWorkItemByIdAsync("REQ-123");
if (result.IsSuccess)
{
    var workItem = result.Value;
    // Work with the item
}
else
{
    var errorMessage = result.Error;
    // Handle error
}

Trimming Support

This library supports trimming in .NET 9 applications, which helps reduce the size of your application by removing unused code. However, since the library uses WCF services that rely on reflection, there are some important considerations when using it in a trimmed application:

Using the Library in a Trimmed Application

When using this library in a trimmed application, you need to annotate your code that calls the Polarion API with the [RequiresUnreferencedCode] attribute:

using System.Diagnostics.CodeAnalysis;

[RequiresUnreferencedCode("Uses Polarion API which requires reflection")]
public async Task<bool> CheckRequirementStatus(string requirementId)
{
    var polarionClient = await PolarionClient.CreateAsync(config);
    var result = await polarionClient.GetWorkItemByIdAsync(requirementId);
    return result.IsSuccess && result.Value.Status == "approved";
}

Creating a TrimmerRoots.xml File

For more complex scenarios, you may need to create a TrimmerRoots.xml file in your application to preserve additional types:

<linker>
  <assembly fullname="YourApplication">
    
    <type fullname="YourNamespace.YourPolarionService" preserve="all" />
  </assembly>
  
  
  <assembly fullname="Polarion" />
</linker>

Add this file to your project as an embedded resource:

<ItemGroup>
  <EmbeddedResource Include="TrimmerRoots.xml" />
</ItemGroup>

Publishing a Trimmed Application

When publishing your application with trimming enabled:

dotnet publish -c Release -r win-x64 --self-contained /p:PublishTrimmed=true

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 308 6/10/2025
0.1.0 155 6/3/2025
0.0.9 147 5/21/2025
0.0.8 219 5/15/2025
0.0.7 218 5/14/2025
0.0.6 335 5/12/2025
0.0.5 248 3/18/2025
0.0.4 173 3/11/2025
0.0.3 156 3/11/2025
0.0.2 159 3/11/2025
0.0.1 195 3/8/2025