Ask or search…
K
🖼

Configuration

This resource represents issue field configurations. Use it to get, set, and delete field configurations and field configuration schemes.
The Jira Issue Field Configurations define the behavior of fields within Jira issues. A field configuration is a set of rules that determines which fields are available for a particular issue type or project, and whether those fields are required, read-only, or hidden. Field configurations can be customized to meet the specific needs of your organization.

Get all Field Configurations

GET /rest/api/{2-3}/fieldconfiguration
Returns a paginated list of field configurations. The list can be for all field configurations or a subset determined by any combination of these criteria:
  • a list of field configuration item IDs.
  • whether the field configuration is a default.
  • whether the field configuration name or description contains a query string.
Only field configurations used in company-managed (classic) projects are returned
This method uses the following parameters:
startAt
The index of the first item to return in a page of results (page offset).
maxResults
The maximum number of items to return per page.
id's
The list of field configuration IDs.
isDefault
If true returns default field configurations only.
query
The query string used to match against field configuration names and descriptions.
package main
import (
"context"
"github.com/ctreminiom/go-atlassian/jira/v2"
_ "github.com/ctreminiom/go-atlassian/jira/v3"
"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)
fieldConfigurations, response, err := atlassian.Issue.Field.Configuration.Gets(
context.Background(),
nil,
false,
0,
50,
)
if err != nil {
log.Fatal(err)
}
log.Println("HTTP Endpoint Used", response.Endpoint)
for _, configuration := range fieldConfigurations.Values {
log.Println(configuration)
}
}

Create Field Configuration

POST /rest/api/{2-3}/fieldconfiguration
Creates a field configuration. The field configuration is created with the same field properties as the default configuration, with all the fields being optional.
Only field configurations used in company-managed (classic) projects are returned
This method uses the following parameters:
description
The description of the field configuration.
name
The name of the field configuration. Must be unique.
package main
import (
"context"
"fmt"
"github.com/ctreminiom/go-atlassian/jira/v2"
_ "github.com/ctreminiom/go-atlassian/jira/v3"
"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)
newFieldConfiguration, response, err := atlassian.Issue.Field.Configuration.Create(
context.Background(),
"Story DUMMY Field Configuration",
"description sample")
if err != nil {
log.Fatal(err)
}
log.Println("HTTP Endpoint Used", response.Endpoint)
fmt.Println(newFieldConfiguration.ID)
fmt.Println(newFieldConfiguration.Name)
fmt.Println(newFieldConfiguration.Description)
fmt.Println(newFieldConfiguration.IsDefault)
}

Update Field Configuration

PUT /rest/api/{2-3}/fieldconfiguration/{id}
Updates a field configuration. The name and the description provided in the request override the existing values.
Only field configurations used in company-managed (classic) projects are returned
package main
import (
"context"
"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)
response, err := atlassian.Issue.Field.Configuration.Update(context.Background(), 10002, "name updated", "")
if err != nil {
log.Fatal(err)
}
log.Println("HTTP Endpoint Used", response.Endpoint)
}

Delete Field Configuration

DELETE /rest/api/{2-3}/fieldconfiguration/{id}
Deletes a field configuration.
Only field configurations used in company-managed (classic) projects are returned
package main
import (
"context"
"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)
response, err := atlassian.Issue.Field.Configuration.Delete(context.Background(), 10002)
if err != nil {
log.Fatal(err)
}
log.Println("HTTP Endpoint Used", response.Endpoint)
}
Last modified 7mo ago