andygrunwald / go-jira

Go client library for Atlassian Jira
https://pkg.go.dev/github.com/andygrunwald/go-jira?tab=doc
MIT License
1.48k stars 471 forks source link

Support Jira Insight #495

Open Fank opened 2 years ago

Fank commented 2 years ago

Jira bought "Insight" a longer time ago and added it to there Cloud APIs using the same authentication methods:

Authentication: For authenticating directly against the REST API, the Insight in Jira Service Management REST API supports basic auth (see Basic auth for REST APIs). Reference https://developer.atlassian.com/cloud/insight/intro/introduction-and-basics/

Additional context

REST Documentation: https://developer.atlassian.com/cloud/insight/rest/

Implemented API

Icon:

Import:

Iql:

Object:

Objectconnectedtickets:

Objectschema:

Objecttype:

Objecttypeattribute:

Progress:

Config:

Global:

andygrunwald commented 2 years ago

See https://gitlab.com/mclgmbh/golang-pkg/jira-insight/-/blob/main/insight/api.go

Fank commented 2 years ago

@andygrunwald While implementing #565 i noticed that all endpoints require a workspace id. So I came up with some ideas right now, should we go for:

1.

client := NewClient(...)
client.Insight.ObjectType.GetAttributes("MyWorkspaceID", "ID")

2.

client := NewClient(...)
client.Insight("MyWorkspaceID").ObjectType.GetAttributes("ID")

3.

client := NewClient(...)
client.Insight.ObjectType.GetAttributes("MyWorkspaceID", "ID")

client2 := NewClient(...)
client2.InsightWithWorkspace("MyWorkspaceID").ObjectType.GetAttributes("ID")
// which is a wrapper for
// client2.Insight.ObjectType.GetAttributes("MyWorkspaceID", "ID")
// so you can do something like:

insight := client2.InsightWithWorkspace("MyWorkspaceID")
insight.ObjectType.Get("ID")
insight.ObjectType.GetAttributes("ID")
...
andygrunwald commented 2 years ago

Personally, I am in favor of option 1, because