
๐คProperties
Get project properties keys
GET /rest/api/{2-3}/project/{projectIdOrKey}/properties
Returns all keys for the project.
package main
import (
"context"
_ "github.com/ctreminiom/go-atlassian/v2/jira/v3"
v2 "github.com/ctreminiom/go-atlassian/v2/jira/v2"
"log"
"os"
)
func main() {
/*
----------- Set an environment variable in git bash -----------
export HOST="https://ctreminiom.atlassian.net/"
export MAIL="MAIL_ADDRESS"
export TOKEN="TOKEN_API"
Docs: https://stackoverflow.com/questions/34169721/set-an-environment-variable-in-git-bash
*/
var (
host = os.Getenv("HOST")
mail = os.Getenv("MAIL")
token = os.Getenv("TOKEN")
)
atlassian, err := v2.New(nil, host)
if err != nil {
log.Fatal(err)
}
atlassian.Auth.SetBasicAuth(mail, token)
properties, response, err := atlassian.Project.Property.Gets(context.Background(), "KP")
if err != nil {
log.Fatal(err)
}
log.Println("HTTP Endpoint Used", response.Endpoint)
for _, key := range properties.Keys {
log.Printf("Key: %v -- Self: %v", key.Key, key.Self)
}
}Get project property
GET /rest/api/{2-3}/project/{projectIdOrKey}/properties/{propertyKey}
Returns the value of a project property.
Set project property
PUT /rest/api/{2-3}/project/{projectIdOrKey}/properties/{propertyKey}
Sets the value of the project property. You can use project properties to store custom data against the project.
Delete project property
DELETE /rest/api/{2-3}/project/{projectIdOrKey}/properties/{propertyKey}
Deletes the property from a project.
Last updated
Was this helpful?