Simple JQL builder for Jira search

Overview

Jql Builder

Latest Version on Packagist Tests Total Downloads

Simple JQL builder for Jira search

Installation

composer require devmoath/jql-builder

Usage

Generate query with one condition:

\DevMoath\JqlBuilder\Jql::query()
    ->whereProject('MY PROJECT')
    ->getQuery(); // "project = 'MY PROJECT'"

Generate query with many conditions:

\DevMoath\JqlBuilder\Jql::query()
    ->whereProject('MY PROJECT')
    ->whereIssueType('support')
    ->whereStatus(['wip', 'created'], Jql::IN)
    ->getQuery(); // "project = 'MY PROJECT' and issuetype = 'support' and status in ('wip', 'created')"

generate query with custom filed conditions:

\DevMoath\JqlBuilder\Jql::query()
    ->where('customfild_111', \DevMoath\JqlBuilder\Jql::EQUAL, 'value')
    ->where('customfild_222', \DevMoath\JqlBuilder\Jql::EQUAL, 'value')
    ->getQuery(); // "customfild_111 = 'value' and customfild_222 = 'value'"

generate query conditions based on your condition:

\DevMoath\JqlBuilder\Jql::query()
    ->when('MY PROJECT', fn (\DevMoath\JqlBuilder\Jql $builder, $value) => $builder->whereProject($value))
    ->when('', fn (\DevMoath\JqlBuilder\Jql $builder, $value) => $builder->whereIssueType($value))
    ->getQuery(); // "project = 'MY PROJECT'"

Also you can add macro functions as well:

$builder = new \DevMoath\JqlBuilder\Jql;

$builder::macro('whereCustom', function ($value) {
    /** @var Jql $this */
    return $this->where('custom', \DevMoath\JqlBuilder\Jql::EQUAL, $value);
});

$builder->whereCustom('1')->getQuery(); // "custom = '1'"

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

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

You might also like...
Production-grade rapid controller development with built in love for API and Search

Installation For CakePHP 4.x compatible version: composer require friendsofcake/crud For CakePHP 3.x compatible version: composer require friendsofca

Google Search Results PHP API via Serp Api

Google Search Results in PHP This Php API is meant to scrape and parse Google, Bing or Baidu results using SerpApi. The full documentation is availabl

An ultra-fast Laravel docs search workflow for Alfred 3+.
An ultra-fast Laravel docs search workflow for Alfred 3+.

Laravel Docs Workflow for Alfred An ultra-fast Laravel docs search workflow for Alfred 3+. Installation Download the latest version Install the workfl

Analyzer of PHP code to search issues with deprecated functionality in newer interpreter versions.

PhpDeprecationDetector PhpDeprecationDetector - analyzer of PHP code to search usages of deprecated functionality in newer interpreter versions - depr

Silverstripe-fulltextsearch - Adds external full text search engine support to SilverStripe

FullTextSearch module Adds support for fulltext search engines like Sphinx and Solr to SilverStripe CMS. Compatible with PHP 7.2 Important notes when

Searchable DataObjects is a module that permit to include DataObjects into frontend search

Searchable DataObjects Searchable DataObjects is a module that permit to include DataObjects into frontend search. Introduction Pages are not always t

Silverstripe-searchable - Adds to the default Silverstripe search by adding a custom results controller and allowing properly adding custom data objects and custom fields for searching

SilverStripe Searchable Module UPDATE - Full Text Search This module now uses Full Text Support for MySQL/MariaDB databases in version 3.* Adds more c

Smile ElasticSuite - Magento 2 merchandising and search engine built on ElasticSearch
Smile ElasticSuite - Magento 2 merchandising and search engine built on ElasticSearch

News ⚠️ Magento versions compatibility : Due to several changes in Magento 2.4.0, we cannot ensure compatibility between ElasticSuite 2.10 and Magent

Algolia Search integration for Magento 1 - compatible with versions from 1.6.x to 1.9.x

Algolia Search for Magento 1.6+ End of Support 🚨 The Algolia Magento 1 extension has reached End of Life regarding support and maintenance. We do not

Comments
  • Add Missing Columns

    Add Missing Columns

    ref: https://confluence.atlassian.com/jiracoreserver073/advanced-searching-fields-reference-861257219.html

    • [x] Project
    • [x] Issue Type
    • [ ] Type
    • [x] Summary
    • [ ] Epic Name
    • [ ] Epic Link
    • [ ] Description
    • [ ] Component
    • [ ] Priority
    • [ ] Linked Issues
    • [ ] Attachment
    • [ ] Labels
    • [ ] Time Tracking
    • [ ] Log Work
    • [ ] Assignee
    • [ ] Reporter
    • [ ] Creator
    • [ ] Comment
    • [ ] Affects Version
    • [ ] Approvals
    • [ ] Category
    • [ ] Fix Version
    • [ ] Story Points
    • [ ] Sprint
    • [x] Status
    • [ ] Resolution
    • [ ] Created
    • [ ] Updated
    • [ ] Due Date
    • [ ] Customer Request Type
    • [ ] Environment
    • [ ] Filter
    • [ ] Fix Version
    • [ ] Issue Key
    • [ ] Last Viewed
    • [ ] Level
    • [ ] Original Estimate
    • [ ] Remaining Estimate
    • [ ] Parent
    • [ ] Request channel type
    • [ ] Request last activity time
    • [ ] Resolved
    • [ ] Text
    • [ ] Time Spent
    • [ ] Voter
    • [ ] Votes
    • [ ] Watcher
    • [ ] Watchers
    • [ ] Work Log Author
    • [ ] Work Log Comment
    • [ ] Work Log Date
    • [ ] Work Ratio
    invalid wontfix 
    opened by devmoath 1
  • [2.x] Make the code stricter

    [2.x] Make the code stricter

    Things to do:

    • [x] Remove spatie/macroable in favor of where closure
    • [x] Drop PHP 8.0 support in favor of enums
    • [x] Remove Laravel Facades support in favor of automatically resolving classes that do not have dependencies
    • [x] Use phpstan/phpstan-strict-rules for stricter rules
    • [x] Remove invalidBooleanOrOperator internal function
    • [x] Use rector/rector for refactoring
    • [ ] Update test suite
    • [ ] Update README.md file
    invalid wontfix 
    opened by devmoath 0
  • Make operator optional and accept `=` by default

    Make operator optional and accept `=` by default

    Example:

    $builder = new Jql();
    
    // instead of this approach
    $builder->where('project', '=', 'value'); // project = "value"
    
    // we should accept this approach
    $builder->where('project', 'value'); // project = "value"
    
    feature 
    opened by devmoath 0
  • Group conditions within parentheses

    Group conditions within parentheses

    Example with or operator:

    (project = "A" and status = Closed) OR (project = "B"  and status != Closed)
    

    Example with and operator:

    (project = "A" and status = Closed) AND (project = "B"  and status != Closed)
    

    More complex example:

    creator = "[email protected]" and (project = "A" and status = Closed) OR (project = "B"  and status != Closed)
    
    feature 
    opened by devmoath 0
Releases(v1.3.2)
  • v1.3.2(Oct 9, 2022)

    What's Changed

    • Fix type error #27 by @devmoath in https://github.com/devmoath/jql-builder/pull/28

    Full Changelog: https://github.com/devmoath/jql-builder/compare/v1.3.1...v1.3.2

    Source code(tar.gz)
    Source code(zip)
  • v1.3.1(Oct 9, 2022)

    What's Changed

    • Clear resolved instance to get new builder each time #23 by @devmoath in https://github.com/devmoath/jql-builder/pull/25
    • Escape spaces in custom field names #24 by @devmoath in https://github.com/devmoath/jql-builder/pull/26

    Full Changelog: https://github.com/devmoath/jql-builder/compare/v1.3.0...v1.3.1

    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(Sep 9, 2022)

    What's Changed

    • :sparkles: internal improvements and php 8.2 support by @devmoath in 4da985ea90160c8e1d5bf0f1d46cd4a7b37ccceb

    Full Changelog: https://github.com/devmoath/jql-builder/compare/v1.2.1...v1.3.0

    Source code(tar.gz)
    Source code(zip)
  • v1.2.1(Jul 19, 2022)

    What's Changed

    • fix phpdoc and document laravel facade by @devmoath in 3f0a387

    Full Changelog: https://github.com/devmoath/jql-builder/compare/v1.2.0...v1.2.1

    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Jul 4, 2022)

    What's Changed

    • add support for Laravel #21 by @devmoath in https://github.com/devmoath/jql-builder/pull/22

    Full Changelog: https://github.com/devmoath/jql-builder/compare/v1.1.0...v1.2.0

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Mar 11, 2022)

    What's Changed

    • group conditions within parentheses #15 by @DevMoath in https://github.com/DevMoath/jql-builder/pull/16
    • make operator optional and accept = by default #17 by @DevMoath in https://github.com/DevMoath/jql-builder/pull/18
    • Add codecov workflow by @DevMoath in https://github.com/DevMoath/jql-builder/pull/19
    • increase test coverage by @DevMoath in https://github.com/DevMoath/jql-builder/pull/20

    Full Changelog: https://github.com/DevMoath/jql-builder/compare/v1.0.0...v1.1.0

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Jan 31, 2022)

    What's Changed

    • Improve workflows by @DevMoath in https://github.com/DevMoath/jql-builder/pull/8
    • Extract the constants to new class base on its type by @DevMoath in https://github.com/DevMoath/jql-builder/pull/9
    • remove my personal username from namespace by @DevMoath in https://github.com/DevMoath/jql-builder/pull/11
    • Escape quotes in value/s by @DevMoath in https://github.com/DevMoath/jql-builder/pull/12
    • remove whereFiled function and use the base where function by @DevMoath in https://github.com/DevMoath/jql-builder/pull/13
    • make when and whenNot accept callback as well (79f4b6a), (1375ffd)
    • add appendQuery function to reduce duplicate code (93c904f)
    • add orderBy function (21e26ed)
    • add rawQuery function (50b79c1)
    • increase the PHPStan level (#6) (cad88cf)
    • return $this if the callback does not return anything (#5) (cf7aaa1)
    • Throw exception when $operator is illegal for the $value type (#2) (3ffedf1)

    Full Changelog: https://github.com/DevMoath/jql-builder/compare/v0.0.3...v1.0.0

    Source code(tar.gz)
    Source code(zip)
  • v0.0.3(Sep 20, 2021)

  • v0.0.2(Sep 17, 2021)

    What's Changed

    • Add when() function to add where clause based on condition (c62c841)
    • Add missing operators and keywords (2c95b62)
    • Add helper functions (ac6fa4e), (63ede81)
    • Add ability to use AND and OR operators between conditions (8d47ae6)
    • Make the Jql class as final class (e9ecf66)
    • Change the logic of creating the conditions which now uses where function as base of all functions (d916039)

    Full Changelog: https://github.com/DevMoath/jql-builder/compare/v0.0.1...v0.0.2

    Source code(tar.gz)
    Source code(zip)
  • v0.0.1(Sep 15, 2021)

search non profitable charity or organization through api search

Non Profile Charity Search Search non profitable organization or get the details of an organization Installation Require the package using composer: c

Touhidur Rahman 5 Jan 20, 2022
Nova Search is an open source search engine developed by the Artado Project.

Loli Search Loli Search açık kaynak kodlu bir arama motorudur ve yalnızca kendi sonuçlarını değil, diğer arama motorlarının sonuçlarını da göstermekte

Artado Project 10 Jul 22, 2022
Doogle is a search engine and web crawler which can search indexed websites and images

Doogle Doogle is a search engine and web crawler which can search indexed websites and images, and then use keywords to be searched later. Written pri

Zepher Ashe 9 Jan 1, 2023
A visual process builder

DataStory ⚡ visual programming DataStory provides a workbench for designing data flow diagrams. ⚠️ We have moved to an organisation ?? Live Demo data-

Anders Jürisoo 120 Dec 12, 2022
Bundle providing Honeypot field for the Form Builder in Ibexa DXP Experience/Commerce (3.X)

IbexaHoneypot Bundle providing Honeypot field for the Form Builder in Ibexa DXP Experience/Commerce (3.X) What is Honey pot? A honey pot trap involves

null 1 Oct 14, 2021
Phalcon Builder - is a packaging system that make it easy and quick to build Phalcon packages such as rpms, debs, etc. Phalcon's distribution that hosted at PackageCloud.

Phalcon Builder - is a packaging system that make it easy and quick to build Phalcon packages such as rpms, debs, etc. Phalcon's distribution that hos

The Phalcon PHP Framework 26 Oct 7, 2022
🧩 Laravel Query Builder integration for PhpStorm

Laravel Query Laravel + DataGrip = ♥️ This plugin provides database integration for Laravel query builder. Features Schemas, tables, views and columns

Ernestas Kvedaras 41 Dec 14, 2022
Drupal Composer Scaffold - A flexible Composer project scaffold builder

This project provides a composer plugin for placing scaffold files (like index.php, update.php, …) from the drupal/core project into their desired location inside the web root. Only individual files may be scaffolded with this plugin.

Drupal 44 Sep 22, 2022
FFCMS 3 version core MVC architecture. Build-on use with ffcms main architecture builder.

FFCMS 3 version core MVC architecture. Build-on use with ffcms main architecture builder.

FFCMS 0 Feb 25, 2022
🎨 Free custom elements for the WordPress Theme Bricks Builder.

?? Custom Elements for Bricks Builder Free custom elements for Bricks, the visual site builder for WordPress. If you find the elements useful, click o

Simon Vidman 33 Dec 13, 2022