jiraclient

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ADFDescription

func ADFDescription(description string, acceptanceCriteria []string, documentURL string) map[string]any

adfDescription renders a work item as an Atlassian Document Format document. ADF has no Markdown fallback: a heading is a heading node and a bullet is a list node, so the same prose that renders on GitHub has to be translated rather than passed through.

Types

type Client

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

Client handles communication with Jira Rest API

func NewClient

func NewClient(httpClient *http.Client, baseURL string, email string, token string) *Client

NewClient creates new Jira API client Accepts custom *http.Client, uses DefaultClient if nil [i.e base URL https://my-domain.atlassian.net and auth creds ]

func (*Client) CreateIssue

func (c *Client) CreateIssue(ctx context.Context, body map[string]any) (*IssueResponse, error)

CreateIssue creates a new issue in Jira

func (c *Client) CreateIssueLink(ctx context.Context, linkType, inwardIssueKey, outwardIssueKey string) error

CreateIssueLink creates a link between two issues

func (*Client) Do

func (c *Client) Do(request *http.Request, responseTarget any) error

Do executes an API request and unmarshals the response body into responseTarget.

func (*Client) GetIssueLinkTypes

func (c *Client) GetIssueLinkTypes(ctx context.Context) ([]string, error)

GetIssueLinkTypes fetches all valid link types on the Jira instance

func (c *Client) GetIssueLinks(ctx context.Context, issueKey string) ([]IssueLink, error)

GetIssueLinks fetches an issue to get its links (used by our Adapter for checking if a link exists)

func (*Client) GetIssueProperty

func (c *Client) GetIssueProperty(ctx context.Context, issueKey, propertyKey string) (string, error)

GetIssueProperty retrieves a property of an issue

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, path string, body any) (*http.Request, error)

NewRequest creates an API request A relative path can be provided, e.g. "/rest/api/3/issue"

func (*Client) SearchJQL

func (c *Client) SearchJQL(ctx context.Context, jql string, maxResults int, nextPageToken string) (*SearchResult, error)

SearchJQL executes a JQL query and returns SearchResult

type IssueLink struct {
	Type        string
	InwardIssue string
}

IssueLink represents an existing link

type IssueResponse

type IssueResponse struct {
	ID  string `json:"id"`
	Key string `json:"key"`
}

IssueResponse is a basic representation of a created / fetched Jira issue

type SearchResult

type SearchResult struct {
	Issues        []IssueResponse `json:"issues"`
	NextPageToken string
	IsLast        bool
}

SearchResult is a response from JQL search

Jump to

Keyboard shortcuts

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