jira

package
v0.0.0-...-b41f85f Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const CustomFieldCVEID = "customfield_11801"

CustomFieldCVEID represents the custom field ID for CVE ID

View Source
const CustomFieldCVEScore = "customfield_11802"

CustomFieldCVEScore represents the custom field ID for CVE score

View Source
const IssueTypeJob = "Job"

IssueTypeJob represents the issue type for job tracking

View Source
const IssueTypeVulnerability = "Vulnerability"

IssueTypeVulnerability represents the issue type for vulnerability tracking

View Source
const StatusCategoryDone = "done"

StatusCategoryDone represents the status category for completed issues

Variables

This section is empty.

Functions

func RenderVulnerabilityTable

func RenderVulnerabilityTable(scanResult *models.ScanResult) (string, error)

RenderVulnerabilityTable renders a vulnerability table from scan results scanResult: The scan results containing vulnerability information Returns the rendered table as a string and any error that occurred

Types

type Client

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

Client represents a Jira client that wraps the underlying Jira client

func NewClient

func NewClient(baseURL string, username, password string) (*Client, error)

NewClient creates a new Jira client with the given credentials baseURL: The base URL of the Jira instance username: The username for authentication password: The password for authentication

func (*Client) CompleteIssue

func (c *Client) CompleteIssue(ctx context.Context, jql *jql.JQL) error

CompleteIssue transitions all issues matching the JQL query to a completed state Also completes any linked child issues

func (*Client) CreateOrUpdateIssue

func (c *Client) CreateOrUpdateIssue(ctx context.Context, jql *jql.JQL, options ...IssueOption) (*jira.Issue, error)

CreateOrUpdateIssue searches for an existing issue matching the JQL query If found, updates it with the provided options; otherwise creates a new issue Returns the created or updated issue

func (*Client) FindOrCreateIssue

func (c *Client) FindOrCreateIssue(ctx context.Context, jql *jql.JQL, options ...IssueOption) (*jira.Issue, error)

FindOrCreateIssue searches for an existing issue matching the JQL query If no matching issue is found or all matching issues are completed, creates a new issue Returns the found or created issue

func (*Client) GetComponentVersion

func (c *Client) GetComponentVersion(ctx context.Context, projectKey string, component string) (string, error)

GetComponentVersion retrieves the version of a component in a project Returns the version name if found, or an error if not found

func (*Client) IsCompletedIssue

func (c *Client) IsCompletedIssue(issue jira.Issue) bool

IsCompletedIssue checks if an issue is in a completed state

func (*Client) LinkIssue

func (c *Client) LinkIssue(ctx context.Context, parent *jira.Issue, child *jira.Issue) error

LinkIssue creates a relationship between a parent and child issue If the link already exists, does nothing

type ClientOption

type ClientOption func(*Client)

ClientOption represents a function that can modify a Client

type IssueOption

type IssueOption func(issue *jira.Issue)

IssueOption represents a function that can modify a Jira issue

func WithAffectsVersion

func WithAffectsVersion(version string) IssueOption

WithAffectsVersion adds an affected version to a Jira issue version: The version that is affected by the issue

func WithAssignee

func WithAssignee(username string) IssueOption

WithAssignee sets the assignee for a Jira issue username: The username of the assignee

func WithCustomField

func WithCustomField(fields map[string]interface{}) IssueOption

WithCustomField sets custom fields for a Jira issue fields: A map of custom field IDs to their values

func WithDescription

func WithDescription(description string) IssueOption

WithDescription sets the description for a Jira issue description: The description text to set

func WithLabels

func WithLabels(labels ...string) IssueOption

WithLabels sets the labels for a Jira issue labels: The labels to set for the issue

func WithPriority

func WithPriority(priority string) IssueOption

WithPriority sets the priority for a Jira issue priority: The priority level to set

func WithProject

func WithProject(project string) IssueOption

WithProject sets the project for a Jira issue project: The project key to set

func WithSummary

func WithSummary(summary string) IssueOption

WithSummary sets the summary for a Jira issue summary: The summary text to set

func WithType

func WithType(issueType string) IssueOption

WithType sets the issue type for a Jira issue issueType: The type of the issue

Jump to

Keyboard shortcuts

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