PHPackages                             bbs-lab/jql-builder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bbs-lab/jql-builder

ActiveLibrary

bbs-lab/jql-builder
===================

JQL builder is a supercharged PHP package that allows you to create Jira Query Language (JQL)

v1.0.0(today)04↑2900%MITPHPPHP ^8.0

Since Apr 3Pushed todayCompare

[ Source](https://github.com/BBS-Lab/jql-builder)[ Packagist](https://packagist.org/packages/bbs-lab/jql-builder)[ RSS](/packages/bbs-lab-jql-builder/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

⚡ JQL Builder
=============

[](#-jql-builder)

 [![Latest Stable Version](https://camo.githubusercontent.com/b9ca34344113c34b52538f7d541e32eafbdf8f48f8d67ddd2599f474026d5608/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6262732d6c61622f6a716c2d6275696c646572)](https://packagist.org/packages/bbs-lab/jql-builder) [![Total Downloads](https://camo.githubusercontent.com/2da4f4a9d9315b700d0ebb48958230f3027c07f937d9072c7a56db34f2d62999/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6262732d6c61622f6a716c2d6275696c646572)](https://packagist.org/packages/bbs-lab/jql-builder) [![PHP Version Require](https://camo.githubusercontent.com/1acb3b18543980e158cac025fe7ac37dc2504f19336c4f0b67745f16974bdd06/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6262732d6c61622f6a716c2d6275696c646572)](https://packagist.org/packages/bbs-lab/jql-builder) [![License](https://camo.githubusercontent.com/cec08874019dbec577510f6ea7b1c4c76e875b2679ff4fa757b2f586234f6a4c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6262732d6c61622f6a716c2d6275696c646572)](https://github.com/bbs-lab/jql-builder/blob/main/LICENSE)

> **JQL Builder** is a supercharged PHP package that allows you to create **Jira Query Language (JQL)** queries programmatically.

---

Requirements
------------

[](#requirements)

- PHP **^8.0**

Installation
------------

[](#installation)

Install the package via [Composer](https://getcomposer.org/):

```
composer require bbs-lab/jql-builder
```

---

Usage
-----

[](#usage)

### Basic example

[](#basic-example)

```
use JqlBuilder\Jql;

$query = new Jql();

$query->where('project', 'PROJECT')
      ->where('summary', '~', 'title');

echo $query; // project = "PROJECT" and summary ~ "title"
```

### `where()`

[](#where)

Add a condition to the query. The default operator is `=`.

```
$query = new Jql();

// Using default operator (=)
$query->where('project', 'MY PROJECT');
// project = "MY PROJECT"

// Using a specific operator
$query->where('summary', '~', 'some text');
// summary ~ "some text"

// Using an array of values (IN operator)
$query->where('status', ['New', 'In Progress', 'Done']);
// status in ("New", "In Progress", "Done")
```

### `orWhere()`

[](#orwhere)

Add an `OR` condition to the query. Accepts the same arguments as `where()`.

```
$query = new Jql();

$query->where('project', 'MY PROJECT')
      ->orWhere('summary', '~', 'sub-issue for "TES-xxx"');
// project = "MY PROJECT" or summary ~ "sub-issue for \"TES-xxx\""
```

### `orderBy()`

[](#orderby)

Sort the results by a given field and direction (`asc` or `desc`).

```
$query = new Jql();

$query->where('project', 'MY PROJECT')
      ->orderBy('created', 'asc');
// project = "MY PROJECT" order by created asc
```

### `when()`

[](#when)

Conditionally add a clause to the query. The closure is only executed when the first argument evaluates to `true`.

```
$query = new Jql();

$onlyOpen = true;

$query->where('project', 'MY PROJECT')
      ->when($onlyOpen, function (Jql $builder) {
          $builder->where('status', 'Open');
      });
// project = "MY PROJECT" and status = "Open"
```

### `macro()`

[](#macro)

Register a custom macro to extend the builder with your own reusable logic, powered by [`spatie/macroable`](https://github.com/spatie/macroable).

```
use JqlBuilder\Jql;

Jql::macro('forProject', function (string $project) {
    /** @var Jql $this */
    return $this->where('project', $project);
});

$query = new Jql();

$query->forProject('MY PROJECT')
      ->where('status', 'Open')
      ->getQuery();
// project = "MY PROJECT" and status = "Open"
```

### `getQuery()`

[](#getquery)

Return the final JQL query string.

```
$query = new Jql();

$result = $query->where('project', 'MY PROJECT')
                ->where('status', ['New', 'Done'])
                ->orWhere('summary', '~', 'sub-issue for "TES-xxx"')
                ->orderBy('created', 'asc')
                ->getQuery();

echo $result;
// project = "MY PROJECT" and status in ("New", "Done") or summary ~ "sub-issue for \"TES-xxx\"" order by created asc
```

---

Laravel Integration
-------------------

[](#laravel-integration)

The package includes a Laravel service provider and facade for seamless integration.

### Facade

[](#facade)

```
use JqlBuilder\Facades\Jql;

$query = Jql::where('project', 'MY PROJECT')
            ->where('status', 'Open')
            ->getQuery();
```

The service provider is auto-discovered via Laravel's package auto-discovery.

---

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

---

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

---

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8cf9fd13f4d32603791fb5ba1796ba8f04c843b99dfa35310ed1499806adc333?d=identicon)[mikaelpopowicz](/maintainers/mikaelpopowicz)

![](https://www.gravatar.com/avatar/c1edc17683ed39a2cc6dbe453c2c5aaa63468fc5b54f13941f260ebe260da211?d=identicon)[Kezho](/maintainers/Kezho)

---

Top Contributors

[![mikaelpopowicz](https://avatars.githubusercontent.com/u/5689944?v=4)](https://github.com/mikaelpopowicz "mikaelpopowicz (2 commits)")

---

Tags

phpsdkbuilderjirajql

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bbs-lab-jql-builder/health.svg)

```
[![Health](https://phpackages.com/badges/bbs-lab-jql-builder/health.svg)](https://phpackages.com/packages/bbs-lab-jql-builder)
```

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)[cryptonator/merchant-php-sdk

Cryptonator.com Merchant API SDK for PHP

2713.7k](/packages/cryptonator-merchant-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
