Go client library for OpenProject
https://docs.openproject.org/api
Basic work-package retrieval (Single work-package with ID 36353 from community.openproject.org) Please check examples folder for different use-cases.
import (
"fmt"
openproj "github.com/manuelbcd/go-openproject"
)
func main() {
client, _ := openproj.NewClient(nil, "https://community.openproject.org/")
wpResponse, _, err := client.WorkPackage.Get("36353", nil)
if err != nil {
panic(err)
}
// Output specific fields from response
fmt.Printf("\n\nSubject: %s \nDescription: %s\n\n", wpResponse.Subject, wpResponse.Description.Raw)
}
Create a single work package
package main
import (
"fmt"
"strings"
openproj "github.com/manuelbcd/go-openproject"
)
func main() {
client, err := openproj.NewClient(nil, "https://youropenproject.url")
if err != nil {
fmt.Printf("\nerror: %v\n", err)
return
}
i := openproj.WorkPackage{
Subject: "This is my test work package",
Description: &openproj.WPDescription{
Format: "textile",
Raw: "This is just a demo workpackage description",
},
}
wpResponse, _, err := client.WorkPackage.Create(&i, "demo-project")
if err != nil {
panic(err)
}
// Output specific fields from response
fmt.Printf("\n\nSubject: %s \nDescription: %s\n\n", wpResponse.Subject, wpResponse.Description.Raw)
}
Endpoint | GET single | GET many | POST | PUT | DELETE |
---|---|---|---|---|---|
Attachments (Info) | ✔️ | ✔️ | implementing | - | pending |
Attachments (Download) | ✔️ | - | - | - | - |
Categories | ✔️ | ✔️ | - | - | - |
Documents | implementing | - | - | - | - |
Projects | ✔️ | ✔️ | ✔️ | pending | pending |
Queries | ✔️ | ✔️ | ✔️ | - | ✔️ |
Schemas | pending | ||||
Statuses | ✔️ | ✔️ | pending | pending | pending |
Users | ✔️ | ✔️ | ✔️ | ✔️ | |
Wiki Pages | ✔️ | pending | pending | pending | pending |
WorkPackages | ✔️ | ✔️ | ✔️ | ✔️ | |
Activities | ✔️ | ✔️ |
Thanks Wieland, Oliver and OpenProject team for your support.
Thank you very much Andy Grunwald for the idea and your base code.
Inspired in Go Jira library