Get project ID via domain method;

This commit is contained in:
naudachu 2023-07-08 14:13:04 +05:00
parent 081d93752d
commit 2cba8c5c26
2 changed files with 5 additions and 5 deletions

View File

@ -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
}

View File

@ -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