Documentation
¶
Index ¶
- Constants
- func RenderVulnerabilityTable(scanResult *models.ScanResult) (string, error)
- type Client
- func (c *Client) CompleteIssue(ctx context.Context, jql *jql.JQL) error
- func (c *Client) CreateOrUpdateIssue(ctx context.Context, jql *jql.JQL, options ...IssueOption) (*jira.Issue, error)
- func (c *Client) FindOrCreateIssue(ctx context.Context, jql *jql.JQL, options ...IssueOption) (*jira.Issue, error)
- func (c *Client) GetComponentVersion(ctx context.Context, projectKey string, component string) (string, error)
- func (c *Client) IsCompletedIssue(issue jira.Issue) bool
- func (c *Client) LinkIssue(ctx context.Context, parent *jira.Issue, child *jira.Issue) error
- type ClientOption
- type IssueOption
- func WithAffectsVersion(version string) IssueOption
- func WithAssignee(username string) IssueOption
- func WithCustomField(fields map[string]interface{}) IssueOption
- func WithDescription(description string) IssueOption
- func WithLabels(labels ...string) IssueOption
- func WithPriority(priority string) IssueOption
- func WithProject(project string) IssueOption
- func WithSummary(summary string) IssueOption
- func WithType(issueType string) IssueOption
Constants ¶
const CustomFieldCVEID = "customfield_11801"
CustomFieldCVEID represents the custom field ID for CVE ID
const CustomFieldCVEScore = "customfield_11802"
CustomFieldCVEScore represents the custom field ID for CVE score
const IssueTypeJob = "Job"
IssueTypeJob represents the issue type for job tracking
const IssueTypeVulnerability = "Vulnerability"
IssueTypeVulnerability represents the issue type for vulnerability tracking
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 ¶
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 ¶
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 ¶
IsCompletedIssue checks if an issue is in a completed state
type ClientOption ¶
type ClientOption func(*Client)
ClientOption represents a function that can modify a Client
type IssueOption ¶
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