JQLBuilder 1.3.0

dotnet add package JQLBuilder --version 1.3.0
NuGet\Install-Package JQLBuilder -Version 1.3.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="JQLBuilder" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JQLBuilder --version 1.3.0
#r "nuget: JQLBuilder, 1.3.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.
// Install JQLBuilder as a Cake Addin
#addin nuget:?package=JQLBuilder&version=1.3.0

// Install JQLBuilder as a Cake Tool
#tool nuget:?package=JQLBuilder&version=1.3.0

JQL Builder

License Tests Build Publish Pre-Release NuGet Version Publish NuGet Version NuGet Downloads

Introduction

This repository houses a C# library designed to provide a JQL (Jira Query Language) builder, aiding programmers in constructing JQL queries programmatically.

The JqlBuilder library provides a fluent interface for constructing Jira Query Language (JQL) queries in a flexible and expressive manner.

For more details about JQL, please refer to the wiki.

Installation

You should install JqlBuilder with NuGet:

NuGet\Install-Package JQLBuilder

Or via the .NET Core command line interface:

dotnet add package JQLBuilder

Either commands, from Package Manager Console or .NET Core CLI, will download and install JqlBuilder and all required dependencies.

Getting Started

To start building JQL queries, use the JqlBuilder.Query entry point. The library follows a fluent API design, allowing you to chain methods to construct complex queries.

JqlBuilder.Query
    .Where(f => f.Project == "example")
    .And(f => f.Assignee == "john.doe")
    .OrderBy(f => f.Project)
    .ThenByDescending(f => f.Priority)
    .ToString();

Query Construction

The library provides extension methods for constructing various parts of a JQL query:

Filtering

  • Where: Start the query with a filter condition.
  • And: Add an AND condition to the existing filter.
  • Or: Add an OR condition to the existing filter.
JqlBuilder.Query
    .Where(f => f.Project == "example")
    .And(f => f.Assignee == "john.doe")
    .Or(f => f.Status == "In Progress");

Ordering

  • OrderBy: Specify the primary ordering field.
  • OrderByDescending: Specify the primary ordering field in descending order.
  • ThenBy: Add secondary ordering fields.
  • ThenByDescending: Add secondary ordering fields in descending order.
JqlBuilder.Query
    .OrderBy(f => f.Project)
    .ThenByDescending(f => f.Priority)
    .ThenBy(f => f.Assignee);

Building

The ToString method is used to obtain the final JQL query string.

JqlBuilder.Query
    .Where(f => f.Project == "example")
    .And(f => f.Assignee == "john.doe")
    .OrderBy(f => f.Project)
    .ThenByDescending(f => f.Priority)
    .ToString();

Supported JQL

The following table lists the supported fields and their corresponding types, along with the supported functions and operations grouped by type

Supported Fields by Type

Fields TYPE Notes
affectedVersion VERSION
assignee HISTORICAL_USER
attachment ATTACHMENT
category CATEGORY
component COMPONENT
creator USER
due DATE
dueDate DATE
fixVersion VERSION
id ISSUE
issue ISSUE
issueKey ISSUE
issueType TYPE
key ISSUE
labels LABELS
parent PARENT
priority PRIORITY
project PROJECT
reporter HISTORICAL_USER
sprint SPRINT
status STATUS
summary TEXT
type TYPE
voter USER
watcher USER
"epic link" EPIC_LINK
filter FILTER
request FILTER
savedFilter FILTER
searchRequest FILTER
projectType PROJECT_TYPE
issueLink ISSUE_LINK
issueLinkType ISSUE_LINK_TYPE
issueLink["LinkType"] ISSUE_LINK Where LinkType is a variable you replace with the issue link type (blocks, duplicates, or is blocked by, for example)
issueLinkType ISSUE_LINK UNSUPPORTED
worklogComment TEXT Unlike other fields, time tracking fields are categorized under the object TimeTracking.
workRatio NUMBER Unlike other fields, time tracking fields are categorized under the object TimeTracking.
worklogDate DATETIME Unlike other fields, time tracking fields are categorized under the object TimeTracking.
timeOriginalEstimate DURATION Unlike other fields, time tracking fields are categorized under the object TimeTracking.
originalEstimate DURATION Unlike other fields, time tracking fields are categorized under the object TimeTracking.
timeEstimate DURATION Unlike other fields, time tracking fields are categorized under the object TimeTracking.
remainingEstimate DURATION Unlike other fields, time tracking fields are categorized under the object TimeTracking.

|timeSpent|

Supported Operators by Type

Fields TYPE
VERSION =, !=, >, >=, <, ⇐, IS, IS NOT, IN, NOT IN
HISTORICAL_USER =, !=, IS, IS NOT, IN, NOT IN, WAS, WAS IN, WAS NOT, WAS NOT IN, CHANGED
ATTACHMENT IS, IS NOT
CATEGORY =, !=, IS, IS NOT, IN, NOT IN
TEXT ~, !~
COMPONENT =, !=, IS, IS NOT, IN, NOT IN
DATE =, !=, >, >=, <, ⇐, IS, IS NOT, IN, NOT IN
USER ~, !~, >, >=, <, ⇐ CHANGED, WAS, WAS IN, WAS NOT, WAS NOT IN
ISSUE =, !=, >, >=, <, ⇐, IN, NOT IN
LABELS =, !=, IS, IS NOT, IN, NOT IN
PARENT = !=, IN, NOT IN
PRIORITY =, !=, >, >=, <, ⇐ IS, IS NOT, IN, NOT IN, WAS, WAS IN, WAS NOT, WAS NOT IN, CHANGED
PROJECT =, !=, IS, IS NOT, IN, NOT IN
SPRINT =, !=, IS, IS NOT, IN, NOT IN
STATUS =, !=, >, >=, <, ⇐ IS, IS NOT, IN, NOT IN, WAS, WAS IN, WAS NOT, WAS NOT IN, CHANGED
TYPE =, !=, IS, IS NOT, IN, NOT IN
EPIC_LINK =, !=, IS, IS NOT, IN, NOT IN
FILTER =, !=, IN, NOT IN
PROJECT_TYPE =, !=, IN, NOT IN
ISSUE_LINK =, !=, IN, NOT IN
ISSUE_LINK_TYPE =, !=, IN, NOT IN
DURATION =, !=, >, >=, <, ⇐, IS, IS NOT, IN, NOT IN

Supported Functions by Type

Type Functions
DATE now, currentLogin, lastLogin, startOfDay, startOfWeek, startOfMonth, startOfYear, endOfDay, endOfWeek, endOfMonth, endOfYear
PROJECT projectsLeadByUser, projectsWhereUserHasPermission, projectsWhereUserHasRole
VERSION latestReleasedVersion, latestUnreleasedVersion, releasedVersions, unreleasedVersions
ISSUE issueHistory, votedIssues, watchedIssues, linkedIssues
USER membersOf, currentUser
HISTORICAL_USER membersOf, currentUser
SPRINT openSprints, closedSprints
COMPONENT componentsLeadByUser
PROJECT_TYPE issueHistory, votedIssues, watchedIssues, linkedIssues

Bibliography

  1. Fields
  2. Functions
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

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
1.3.0 82 2/18/2024
1.3.0-pre.77b50f4 48 2/18/2024
1.2.0 87 1/30/2024
1.1.5 83 1/28/2024
1.1.4 74 1/28/2024
1.1.3 89 1/28/2024
1.1.2 83 1/28/2024
1.1.1 93 1/28/2024
1.1.0 115 1/28/2024
1.0.92 95 1/20/2024
1.0.92-alpha1.0.d94cc32 57 1/20/2024
1.0.91 149 12/23/2023
1.0.91-alpha1.0.80949c7 82 12/23/2023
1.0.90 97 12/23/2023
1.0.90-alpha1.0.7d5d4e8 67 12/23/2023
1.0.80 94 12/23/2023
1.0.80-alpha1.2.7d5d4e8 74 12/23/2023
1.0.80-alpha1.0.66c47d0 74 12/23/2023
1.0.72 88 12/23/2023
1.0.72-alpha.e6eaa37 70 12/23/2023
1.0.71-rc.ffc43be 73 12/23/2023
1.0.70-rc.f8a64fd 72 12/23/2023
1.0.60-rc.48b70041a5d29a1b4... 73 12/23/2023
1.0.50-rc 89 12/23/2023
1.0.43-pre 71 12/23/2023
1.0.42 103 12/23/2023
1.0.41 101 12/23/2023
1.0.40 118 12/23/2023
1.0.20 107 12/22/2023
1.0.19 105 12/22/2023
1.0.10 113 12/22/2023
1.0.9 110 12/22/2023
1.0.8 106 12/22/2023
1.0.7 102 12/22/2023
1.0.1 111 12/22/2023
1.0.0 93 12/21/2023