The Issue field configuration schemes let you apply a field configuration to all issues of a certain type. When you want to change the fields that appear on all Bug issue types in a certain project, you can do so by simply configuring the associated field configuration scheme. You can also save time by reusing the same field configuration for issue types across multiple projects.
Get Field Configuration Schemes
GET /rest/api/{2-3}/fieldconfigurationscheme
Returns a paginated list of field configuration schemes.
GET /rest/api/{2-3}/fieldconfigurationscheme/mapping
Returns a paginated list of field configuration issue type items.
package main
import (
"context"
"fmt"
v2 "github.com/ctreminiom/go-atlassian/jira/v2"
"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)
items, response, err := atlassian.Issue.Field.Configuration.Scheme.Mapping(context.Background(), []int{10000}, 0, 50)
if err != nil {
log.Fatal(err)
}
log.Println("HTTP Endpoint Used", response.Endpoint)
for _, item := range items.Values {
fmt.Println(item)
}
}
Get Field Configuration Schemes by Project
GET /rest/api/{2-3}/fieldconfigurationscheme/project
Returns a paginated list of field configuration schemes and, for each scheme, a list of the projects that use it.
The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to the default field configuration scheme.
package main
import (
"context"
"fmt"
"github.com/ctreminiom/go-atlassian/jira/v2"
"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)
items, response, err := atlassian.Issue.Field.Configuration.Scheme.Project(context.Background(), []int{10003}, 0, 50)
if err != nil {
log.Println(response.Bytes.String())
log.Fatal(err)
}
log.Println("HTTP Endpoint Used", response.Endpoint)
for _, item := range items.Values {
fmt.Println(item.ProjectIds)
fmt.Println(item.FieldConfigurationScheme)
}
}
Assign Field Configuration Scheme
PUT /rest/api/{2-3}/fieldconfigurationscheme/project
Assigns a field configuration scheme to a project. If the field configuration scheme ID is null, the operation assigns the default field configuration scheme.