func (i *Integration) CreateIssue(event *output.ResultEvent) error {
	summary := format.Summary(event)
	description := format.MarkdownDescription(event)
	labels := []string{}
	severityLabel := fmt.Sprintf("Severity: %s", event.Info.SeverityHolder.Severity.String())
	if i.options.SeverityAsLabel && severityLabel != "" {
		labels = append(labels, severityLabel)
	}
	if label := i.options.IssueLabel; label != "" {
		labels = append(labels, label)
	}
	_, _, err := i.client.Issues.CreateIssue(i.options.ProjectName, &gitlab.CreateIssueOptions{
		Title:       &summary,
		Description: &description,
		Labels:      labels,
		AssigneeIDs: []int{i.userID},
	})
	return err
}
CreateIssue creates an issue in the tracker
package gitlab
import (
	"fmt"
	"strings"
	"github.com/pkg/errors"
	"github.com/projectdiscovery/nuclei/v2/pkg/output"
	"github.com/projectdiscovery/nuclei/v2/pkg/reporting/format"
	"github.com/xanzy/go-gitlab"
)
type Integration struct {
	client  *gitlab.Client
	userID  int
	options *Options
}
type Options struct {
	BaseURL string `yaml:"base-url"`
	Username string `yaml:"username"`
	Token string `yaml:"token"`
	ProjectName string `yaml:"project-name"`
	IssueLabel string `yaml:"issue-label"`
	SeverityAsLabel bool `yaml:"severity-as-label"`
}
func New(options *Options) (*Integration, error) {
	err := validateOptions(options)
	if err != nil {
		return nil, err
	}
	gitlabOpts := []gitlab.ClientOptionFunc{}
	if options.BaseURL != "" {
		gitlabOpts = append(gitlabOpts, gitlab.WithBaseURL(options.BaseURL))
	}
	git, err := gitlab.NewClient(options.Token, gitlabOpts...)
	if err != nil {
		return nil, err
	}
	user, _, err := git.Users.CurrentUser()
	if err != nil {
		return nil, err
	}
	return &Integration{client: git, userID: user.ID, options: options}, nil
}
func validateOptions(options *Options) error {
	errs := []string{}
	if options.Username == "" {
		errs = append(errs, "Username")
	}
	if options.Token == "" {
		errs = append(errs, "Token")
	}
	if options.ProjectName == "" {
		errs = append(errs, "ProjectName")
	}
	if len(errs) > 0 {
		return errors.New("Mandatory reporting configuration fields are missing: " + strings.Join(errs, ","))
	}
	return nil
}