Get project ID via domain method;
This commit is contained in:
parent
081d93752d
commit
2cba8c5c26
|
|
@ -25,14 +25,14 @@ func (wc *WorkflowController) CreateTask(t *Task) (*Task, error) {
|
||||||
|
|
||||||
yt := wc.iYouTrack
|
yt := wc.iYouTrack
|
||||||
|
|
||||||
projects, err := yt.GetProjects()
|
projectID, err := yt.GetProjectIDByName("ETMD")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Description += fmt.Sprintf("\n\n Created by: [%s](%s)", t.Creator, t.CreatorLink)
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,13 @@ import (
|
||||||
func (wc *WorkflowController) Workflow(name string) (string, error) {
|
func (wc *WorkflowController) Workflow(name string) (string, error) {
|
||||||
yt := wc.iYouTrack
|
yt := wc.iYouTrack
|
||||||
|
|
||||||
projects, err := yt.GetProjects()
|
projectID, err := yt.GetProjectIDByName("APP")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
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 {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue