
๐บ๏ธStatus
Not found
Search Workflow Statuses
package main
import (
"context"
"fmt"
v2 "github.com/ctreminiom/go-atlassian/v2/jira/v2"
"github.com/ctreminiom/go-atlassian/pkg/infra/models"
"log"
"os"
)
func main() {
var (
host = os.Getenv("HOST")
mail = os.Getenv("MAIL")
token = os.Getenv("TOKEN")
)
atlassian, err := v2.New(nil, host)
if err != nil {
return
}
atlassian.Auth.SetBasicAuth(mail, token)
options := &models.WorkflowStatusSearchParams{
ProjectID: "10000",
StatusCategory: "IN_PROGRESS",
Expand: []string{"usages"},
}
var projectStatuses []*models.WorkflowStatusDetailScheme
var startAt int
for {
page, response, err := atlassian.Workflow.Status.Search(context.Background(), options, startAt, 50)
if err != nil {
log.Println(response.Code)
log.Println(response.Endpoint)
log.Fatal(err)
}
projectStatuses = append(projectStatuses, page.Values...)
if page.IsLast {
break
}
startAt = startAt + 50
}
for _, status := range projectStatuses {
fmt.Println(status.Name, status.ID, status.StatusCategory)
fmt.Println("--------------------------------")
fmt.Println("Status Name:", status.Name)
fmt.Println("Status ID:", status.ID)
fmt.Println("Status Category:", status.StatusCategory)
for index, project := range status.Usages {
fmt.Println("--- Project Usage #", index)
fmt.Println("---- Project ID:", project.Project.ID)
fmt.Println("---- Project IssueTypes:", project.IssueTypes)
}
fmt.Println("--------------------------------")
}
}Gets Workflow Statuses
Create Workflow Statuses
Update Workflow Statuses
Delete Workflow Statuses
Bulk Workflow Statuses
Get Workflow Status
Last updated
Was this helpful?