jql

package
v1.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package jql is a very simple JQL query builder that cannot do a lot at the moment.

There is no JQL syntax check and relies on the package user to construct a valid query.

It cannot combine AND and OR query currently. That means you cannot construct a query like the one below: project="JQL" AND issue in openSprints() AND (type="Story" OR resolution="Done")

Index

Constants

View Source
const (
	// DirectionAscending is an ascending sort order.
	DirectionAscending = "ASC"
	// DirectionDescending is a descending sort order.
	DirectionDescending = "DESC"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupFunc

type GroupFunc func()

GroupFunc groups AND and OR operators.

type JQL

type JQL struct {
	// contains filtered or unexported fields
}

JQL is a jira query language constructor.

func NewJQL

func NewJQL(project string) *JQL

NewJQL initializes jql query builder.

func (*JQL) And

func (j *JQL) And(fn GroupFunc) *JQL

And combines filter with AND operator.

func (*JQL) FilterBy

func (j *JQL) FilterBy(field, value string) *JQL

FilterBy filters with a given field.

If the value is `x`, it construct the query with IS EMPTY operator, uses equals otherwise.

func (*JQL) Gt

func (j *JQL) Gt(field, value string, wrap bool) *JQL

Gt is a greater than filter.

func (*JQL) Gte

func (j *JQL) Gte(field, value string, wrap bool) *JQL

Gte is a greater than and equals filter.

func (*JQL) History

func (j *JQL) History() *JQL

History search through user issue history.

func (*JQL) In

func (j *JQL) In(field string, value ...string) *JQL

In constructs a query with IN clause.

func (*JQL) Lt

func (j *JQL) Lt(field, value string, wrap bool) *JQL

Lt is a less than filter.

func (*JQL) NotIn added in v1.2.0

func (j *JQL) NotIn(field string, value ...string) *JQL

NotIn constructs a query with NOT IN clause.

func (*JQL) Or

func (j *JQL) Or(fn GroupFunc) *JQL

Or combine filters with OR operator.

func (*JQL) OrderBy

func (j *JQL) OrderBy(field, dir string) *JQL

OrderBy orders the output in given direction.

func (*JQL) Raw

func (j *JQL) Raw(q string) *JQL

Raw sets the passed JQL query along with project context.

func (*JQL) String

func (j *JQL) String() string

String returns the constructed query.

func (*JQL) Watching

func (j *JQL) Watching() *JQL

Watching search through watched issues.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL