From 2cba8c5c267c0a80a8edc3910a615b8dfd609b56 Mon Sep 17 00:00:00 2001 From: naudachu Date: Sat, 8 Jul 2023 14:13:04 +0500 Subject: [PATCH] Get project ID via domain method; --- bot/controller/task.go | 4 ++-- bot/controller/ticket-workflow.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bot/controller/task.go b/bot/controller/task.go index 8749b9f..533f5e7 100644 --- a/bot/controller/task.go +++ b/bot/controller/task.go @@ -25,14 +25,14 @@ func (wc *WorkflowController) CreateTask(t *Task) (*Task, error) { yt := wc.iYouTrack - projects, err := yt.GetProjects() + projectID, err := yt.GetProjectIDByName("ETMD") if err != nil { return nil, err } t.Description += fmt.Sprintf("\n\n Created by: [%s](%s)", t.Creator, t.CreatorLink) - issue, err := yt.CreateIssue(projects[1].ID, t.Creator+" | "+t.Summary, t.Description) + issue, err := yt.CreateIssue(projectID, t.Creator+" | "+t.Summary, t.Description) if err != nil { return nil, err } diff --git a/bot/controller/ticket-workflow.go b/bot/controller/ticket-workflow.go index 7b7cc6f..fcbb5f1 100644 --- a/bot/controller/ticket-workflow.go +++ b/bot/controller/ticket-workflow.go @@ -9,13 +9,13 @@ import ( func (wc *WorkflowController) Workflow(name string) (string, error) { yt := wc.iYouTrack - projects, err := yt.GetProjects() - + projectID, err := yt.GetProjectIDByName("APP") if err != nil { return "", err } - issue, err := yt.CreateIssue(projects[1].ID, name, "") + // Create an issue at the available project with the provided name + issue, err := yt.CreateIssue(projectID, name, "") if err != nil { return "", err