Giter Site home page Giter Site logo

ctreminiom / go-atlassian Goto Github PK

View Code? Open in Web Editor NEW
108.0 2.0 25.0 7.47 MB

✨ Golang Client Library for Atlassian Cloud.

Home Page: https://docs.go-atlassian.io

License: MIT License

Go 100.00%
jira confluence jira-service-management api-client jira-api confluence-api jira-service-management-api jira-agile-api jira-cloud-api jira-client

go-atlassian's Introduction

Releases Testing codecov Go Reference Go Report Card FOSSA Status Codacy Badge GitHub Mentioned in Awesome Go-Atlassian OpenSSF Best Practices Documentation Dependency Review Analysis

go-atlassian is a Go library that provides a simple and convenient way to interact with various Atlassian products' REST APIs. Atlassian is a leading provider of software and tools for software development, project management, and collaboration. Some of the products that go-atlassian supports include Jira, Confluence, Jira Service Management, and more.

The go-atlassian library is designed to simplify the process of building Go applications that interact with Atlassian products. It provides a set of functions and data structures that can be used to easily send HTTP requests to the Atlassian APIs, parse the responses, and work with the data returned.


🚀Features

  • Easy-to-use functions and data structures that abstract away much of the complexity of working with the APIs.
  • Comprehensive support for various Atlassian products' APIs.
  • Support for common operations like creating, updating, and deleting entities in Atlassian products.
  • Active development and maintenance by the community, with regular updates and bug fixes.
  • Comprehensive documentation and examples to help developers get started with using the library.

📁 Installation

If you do not have Go installed yet, you can find installation instructions here. Please note that the package requires Go version 1.17 or later for module support.

To pull the most recent version of go-atlassian, use go get.

go get github.com/ctreminiom/go-atlassian

📪 Packages

Then import the package into your project as you normally would. You can import the following packages:

Module Path URL's
Jira v2 github.com/ctreminiom/go-atlassian/jira/v2 Getting Started
Jira v3 github.com/ctreminiom/go-atlassian/jira/v3 Getting Started
Jira Software Agile github.com/ctreminiom/go-atlassian/jira/agile Getting Started
Jira Service Management github.com/ctreminiom/go-atlassian/jira/sm Getting Started
Jira Assets github.com/ctreminiom/go-atlassian/assets Getting Started
Confluence github.com/ctreminiom/go-atlassian/confluence Getting Started
Confluence v2 github.com/ctreminiom/go-atlassian/confluence/v2 Getting Started
Admin Cloud github.com/ctreminiom/go-atlassian/admin Getting Started
Bitbucket Cloud (In Progress)
github.com/ctreminiom/go-atlassian/bitbucket Getting Started

🔨 Usage

Before using the go-atlassian package, you need to have an Atlassian API key. If you do not have a key yet, you can sign up here.

Create a client with your instance host and access token to start communicating with the Atlassian API's. In this example, we're going to instance a new Confluence Cloud client.

instance, err := confluence.New(nil, "INSTANCE_HOST")
if err != nil {
    log.Fatal(err)
}
instance.Auth.SetBasicAuth("YOUR_CLIENT_MAIL", "YOUR_APP_ACCESS_TOKEN")

If you need to use a preconfigured HTTP client, simply pass its address to the New function.

transport := http.Transport{
	Proxy: http.ProxyFromEnvironment,
	Dial: (&net.Dialer{
		// Modify the time to wait for a connection to establish
		Timeout:   1 * time.Second,
		KeepAlive: 30 * time.Second,
	}).Dial,
	TLSHandshakeTimeout: 10 * time.Second,
}
client := http.Client{
	Transport: &transport,
	Timeout:   4 * time.Second,
}
instance, err := confluence.New(&client, "INSTANCE_HOST")
if err != nil {
	log.Fatal(err)
}
instance.Auth.SetBasicAuth("YOUR_CLIENT_MAIL", "YOUR_APP_ACCESS_TOKEN")

☕Cookbooks

For detailed examples and usage of the go-atlassian library, please refer to our Cookbook. This section provides step-by-step guides and code samples for common tasks and scenarios.


🌍 Services

The library uses the services interfaces to provide a modular and flexible way to interact with Atlassian products' REST APIs. It defines a set of services interfaces that define the functionality of each API, and then provides implementations of those interfaces that can be used to interact with the APIs.

// BoardConnector represents the Jira boards.
// Use it to search, get, create, delete, and change boards.
type BoardConnector interface {
	Get(ctx context.Context, boardID int) (*model.BoardScheme, *model.ResponseScheme, error)
	Create(ctx context.Context, payload *model.BoardPayloadScheme) (*model.BoardScheme, *model.ResponseScheme, error)
	Filter(ctx context.Context, filterID, startAt, maxResults int) (*model.BoardPageScheme, *model.ResponseScheme, error)
	Backlog(ctx context.Context, boardID int, opts *model.IssueOptionScheme, startAt, maxResults int) (*model.BoardIssuePageScheme, *model.ResponseScheme, error)
	Configuration(ctx context.Context, boardID int) (*model.BoardConfigurationScheme, *model.ResponseScheme, error)
	Epics(ctx context.Context, boardID, startAt, maxResults int, done bool) (*model.BoardEpicPageScheme, *model.ResponseScheme, error)
	IssuesWithoutEpic(ctx context.Context, boardID int, opts *model.IssueOptionScheme, startAt, maxResults int) (
		*model.BoardIssuePageScheme, *model.ResponseScheme, error)
	IssuesByEpic(ctx context.Context, boardID, epicID int, opts *model.IssueOptionScheme, startAt, maxResults int) (
		*model.BoardIssuePageScheme, *model.ResponseScheme, error)
	Issues(ctx context.Context, boardID int, opts *model.IssueOptionScheme, startAt, maxResults int) (*model.BoardIssuePageScheme,
		*model.ResponseScheme, error)
	Move(ctx context.Context, boardID int, payload *model.BoardMovementPayloadScheme) (*model.ResponseScheme, error)
	Projects(ctx context.Context, boardID, startAt, maxResults int) (*model.BoardProjectPageScheme, *model.ResponseScheme, error)
	Sprints(ctx context.Context, boardID, startAt, maxResults int, states []string) (*model.BoardSprintPageScheme,
		*model.ResponseScheme, error)
	IssuesBySprint(ctx context.Context, boardID, sprintID int, opts *model.IssueOptionScheme, startAt, maxResults int) (
		*model.BoardIssuePageScheme, *model.ResponseScheme, error)
	Versions(ctx context.Context, boardID, startAt, maxResults int, released bool) (*model.BoardVersionPageScheme,
		*model.ResponseScheme, error)
	Delete(ctx context.Context, boardID int) (*model.ResponseScheme, error)
	Gets(ctx context.Context, opts *model.GetBoardsOptions, startAt, maxResults int) (*model.BoardPageScheme,
		*model.ResponseScheme, error)
}

Each service interface includes a set of methods that correspond to the available endpoints in the corresponding API. For example, the IssueService interface includes methods like Create, Update, and Get that correspond to the POST, PUT, and GET endpoints in the Jira Issues API.


🎉 Implementation

Behind the scenes, the Create method on the IssueService interface is implemented by the issueService.Create function in the go-atlassian library. This function sends an HTTP request to the relevant endpoint in the Jira Issues API, using the credentials and configuration provided by the client, and then parses the response into a usable format.

Here's a little example about how to get the issue transitions using the Issue service.

ctx := context.Background()
issueKey := "KP-2"
expand := []string{"transitions"}
issue, response, err := atlassian.Issue.Get(ctx,issueKey, nil, expand)
if err != nil {
	log.Fatal(err)
}
log.Println(issue.Key)
for _, transition := range issue.Transitions {
	log.Println(transition.Name, transition.ID, transition.To.ID, transition.HasScreen)
}

The rest of the service functions work much the same way; they are concise and behave as you would expect. The documentation contains several examples on how to use each service function.


✍️ Contributions

If you would like to contribute to this project, please adhere to the following guidelines.

  • Submit an issue describing the problem.
  • Fork the repo and add your contribution.
  • Follow the basic Go conventions found here.
  • Create a pull request with a description of your changes.

Again, contributions are greatly appreciated!


💡 Inspiration

The project was created with the purpose to provide a unique point to provide an interface for interacting with Atlassian products.

This module is highly inspired by the Go library https://github.com/andygrunwald/go-jira but focused on Cloud solutions.

The library shares many similarities with go-jira, including its use of service interfaces to define the functionality of each API, its modular and flexible approach to working with Atlassian products' API's. However, go-atlassian also adds several new features and improvements that are not present in go-jira.

Despite these differences, go-atlassian remains heavily inspired by go-jira, and many of the core design principles and patterns used in go-jira can be found in go-atlassian as well.


📝 License

Copyright © 2023 Carlos Treminio. This project is MIT licensed.

FOSSA Status


🤝 Special Thanks

We would like to extend our sincere thanks to the following sponsors for their generous support:

  • Atlassian for providing us Atlassian Admin/Jira/Confluence Standard licenses.
  • JetBrains for providing us with free licenses of GoLand
  • GitBook for providing us non-profit / open-source plan so hence I would like to express my thanks here.

go-atlassian's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

go-atlassian's Issues

Add issue array custom field access

Is your feature request related to a problem? Please describe.
When i am trying to filter for specific issues (using v3.Issue.Search.Post()) and then want to extract the custom fields from the search i need to custom unmarshal each field.

Describe the solution you'd like
It would be nice to have to have something like models.ParseFloatCustomField() for arrays, in this case to parse the v3.Issue.Search.Post() raw response output.

Describe alternatives you've considered
Copy paste the content of models.ParseFloatCustomField() and other functions to read the custom field values.

Additional context

Parse the `GET /rest/api/3/mypreferences` endpoint

Is your feature request related to a problem? Please describe.
Right now, the library doesn't support the ability to manipulate the Jira Myself endpoints, please create a new implementation of it.

Describe the solution you'd like
Please implement the Get method on the MySelfConnector interface.

image

Describe the tasks needed

  • Under the MySelfConnector interface, create the method Get with the corresponding documentation (comments).
  • Edit the file jira/internal/myself_impl.go and create the Get implementation (please use the other service as a reference).
  • Create the unit test cases with a minimum of 80% of coverage.

Additional context

CLI for atlassian - Enhancement

It would be great to develop a cli for atlassian (like github cli "gh"), maybe it could be another project which use many of this repo code

Benefits:

  • This could help to some automation task for CI/CD
  • A better and easy way to interact with atlassian

Parse the `PUT /rest/api/3/mypreferences` endpoint

Is your feature request related to a problem? Please describe.
Right now, the library doesn't support the ability to manipulate the Jira Myself endpoints, please create a new implementation of it.

Describe the solution you'd like
Please implement the Set method on the MySelfConnector interface.

image

Describe the tasks needed

  • Under the MySelfConnector interface, create the method Set with the corresponding documentation (comments).
  • Edit the file jira/internal/myself_impl.go and create the Set implementation (please use the other service as a reference).
  • Create the unit test cases with a minimum of 80% of coverage.

Additional context

Parse the `POST /rest/api/3/jql/parse endpoint`

Is your feature request related to a problem? Please describe.
Right now, the library doesn't support the ability to parse the JQL queries, please create a new implementation of it.

Describe the solution you'd like
Please create an interface called JQLConnector and implement the Parse method

Describe the tasks needed

  • Under the JQLConnector interface, create the method Parse with the corresponding documentation (comments).
  • Create the Parse implementation (please use the other service as a reference).
  • Create the unit test cases with a minimum of 80% of coverage.

Additional context

Enable `/rest/agile/1.0/backlog` endpoints

Is your feature request related to a problem? Please describe.
Right now, the library doesn't support the ability to manipulate the Jira Agile Backlogs

Describe the solution you'd like
Please implement the BacklogService on the Jira agile modules.

Describe the tasks needed

  • Create an interface called BacklogConnector
  • Under the interface, create two methods (Move, MoveByBoard) with their corresponding documentation (comments).
  • Create a file called backlog_impl under the jira/agile/internal folder.
  • Create the dedicated go structs under the pkg/infra/models folder.
  • Create a new implementation of the interface (please use the other service as a reference).
  • Create the unit test cases with a minimum of 80% of coverage.

image

Additional context

Unable To Specify ParentID For Conf v2 POST Create Page

go-atlassian version
Most Recent (v1.5.0)

go-atlassian component

  • Jira Software Cloud
  • Jira Agile Cloud
  • Jira Service Management Cloud
  • Confluence Cloud
  • Atlassian Admin Cloud

Describe the bug 🐛
This bug is a miss in that the request body to POST /wiki/api/v2/pages may include parentId but go-atlassian does not include it in models.PageCreatePayloadScheme.

To Reproduce 🚧
Steps to reproduce the behavior:

  1. Create a new models.PageCreatePayloadScheme
  2. Observe no ParentID member.

Expected behavior
A clear and concise description of what you expected to happen.
Expected a ParentID member.

Screenshots 📄
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Code snippet

package main

import (
	"context"
	"github.com/ctreminiom/go-atlassian/jira"
	"log"
	"os"
)

func main() {

	var (
		host  = os.Getenv("HOST")
		mail  = os.Getenv("MAIL")
		token = os.Getenv("TOKEN")
	)

	jiraCloud, err := jira.New(nil, host)
	if err != nil {
		return
	}

	jiraCloud.Auth.SetBasicAuth(mail, token)
	jiraCloud.Auth.SetUserAgent("curl/7.54.0")

	// Steps to reproduce
	payload := &models.PageCreatePayloadScheme{
		SpaceID:  203718658,
		Status:   "current",
		Title:    "Page create title test",
		ParentID: 12345678,       // <- Compile error: "Unknown field 'ParentID' in struct literal"
	}
}

Enable `/wiki/rest/api/analytics/` endpoints

Is your feature request related to a problem? Please describe.
Right now, the library doesn't support the ability to manipulate the Confluence page analytics

Describe the solution you'd like
Please implement the AnalyticsService on the Confluence module.

Describe the tasks needed

  • Create an interface called AnalyticsConnector
  • Under the interface, create two methods (Get, Gets) with their corresponding documentation (comments).
  • Create a file called backlog_impl under the confluence/internal folder.
  • Create the dedicated go structs under the pkg/infra/models folder.
  • Create a new implementation of the interface (please use the other service as a reference).
  • Create the unit test cases with a minimum of 80% of coverage.

image
Additional context

unmarshal array error on IssueSearchService

go-atlassian version

v1.0.0

go-atlassian component

  • Jira Software Cloud
  • Jira Agile Cloud
  • Jira Service Management Cloud
  • Confluence Cloud
  • Atlassian Admin Cloud

Describe the bug 🐛

The Search Get/Post methods are not able to unmarshal the response body when one issue contains more than 2 components assigned and it's returning the following error:

bash error: json: cannot unmarshal array into Go struct field IssueFieldsScheme.issues.fields.components of type jira.ProjectComponentScheme

To Reproduce 🚧

  1. Go to the Jira Cloud UI issue details view
  2. Edit the issue adding N+1 components.
  3. Search issues using the library with all fields
  4. Loop the IssueSearchScheme struct

Expected behavior ✅

Render the issue components.

Screenshots:page_facing_up:

If applicable, add screenshots to help explain your problem.

Additional context

The component tab is not a slice of structs so if the issue contains more than 1 component, the method breaks

Components *ProjectComponentScheme json:"components,omitempty"

Add any other context about the problem here.

Code snippet

package main

import (
	"context"
	"github.com/ctreminiom/go-atlassian/jira"
	"log"
	"os"
)

func main() {

	var (
		host  = os.Getenv("HOST")
		mail  = os.Getenv("MAIL")
		token = os.Getenv("TOKEN")
	)

	jiraCloud, err := jira.New(nil, host)
	if err != nil {
		return
	}

	jiraCloud.Auth.SetBasicAuth(mail, token)
	jiraCloud.Auth.SetUserAgent("curl/7.54.0")

	var (
		jql    = "order by created DESC"
		fields = []string{"all"}
		expand = []string{"changelog", "renderedFields", "names", "schema", "transitions", "operations", "editmeta"}
	)

	issues, response, err := atlassian.Issue.Search.Get(context.Background(), jql, fields, expand, 0, 50, "")
	if err != nil {
		if response != nil {
			log.Println("Response HTTP Response", string(response.BodyAsBytes))
		}
		log.Fatal(err)
	}

	log.Println("Response HTTP Code", response.StatusCode)
	log.Println("HTTP Endpoint Used", response.Endpoint)

}

Parse the `DELETE /rest/api/3/mypreferences` endpoint

Is your feature request related to a problem? Please describe.
Right now, the library doesn't support the ability to manipulate the Jira Myself endpoints, please create a new implementation of it.

Describe the solution you'd like
Please implement the Delete method on the MySelfConnector interface.

image

Describe the tasks needed

  • Under the MySelfConnector interface, create the method Delete with the corresponding documentation (comments).
  • Edit the file jira/internal/myself_impl.go and create the Delete implementation (please use the other service as a reference).
  • Create the unit test cases with a minimum of 80% of coverage.

Additional context

Add Atlassian Jira Assets

Is your feature request related to a problem? Please describe.
no.

Describe the solution you'd like
I would like to have Jira-native asset and configuration management support in this package.

Describe alternatives you've considered
I implemented multiple different solutions in the past to be able to communicate with assets:

Additional context
Assets in Jira was called "Insights" in the past, blog post.

The User.Find method does not parse the query param

go-atlassian version

go-atlassian component

  • Jira Software Cloud

Describe the bug 🐛
The User.Find method does not parse the query param

To Reproduce 🚧
Follow this documentation: https://docs.go-atlassian.io/jira-software-cloud/users/search#find-users

Expected behavior
The ability to parse the query param

Code snippet

package main

import (
	"context"
	"github.com/ctreminiom/go-atlassian/jira"
	"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 := jira.New(nil, host)
	if err != nil {
		log.Fatal(err)
	}

	atlassian.Auth.SetBasicAuth(mail, token)

	var (
		accountID  = ""
		query      = ""
		startAt    = 0
		maxResults = 50
	)

	users, response, err := atlassian.User.Search.Do(context.Background(), accountID, query, startAt, maxResults)
	if err != nil {
		if response != nil {
			log.Println("Response HTTP Response", string(response.BodyAsBytes))
		}
		log.Fatal(err)
	}

	log.Println("Response HTTP Code", response.StatusCode)
	log.Println("HTTP Endpoint Used", response.Endpoint)

	for _, user := range *users {
		log.Println(user)
	}

}

Enable ` /rest/api/{2-3}/status` endpoints

Is your feature request related to a problem? Please describe.
Right now, the library doesn't support the ability to manipulate the Jira Workflow Active statuses

Describe the solution you'd like
Please implement the two new endpoint on the WorkflowStatusConnector interface

image
Additional context

[- https://developer.atlassian.com/cloud/jira/software/rest/api-group-backlog/#api-group-backlog](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-statuses/#api-group-workflow-statuses)

Enable to ability to delete an issue with a sub-tasks

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Document the FieldConfigurationService.Assign method

The FieldConfigurationService.Assign method is not documented.

// Assign Assigns a field configuration scheme to a project.
// If the field configuration scheme ID is null, the operation assigns the default field configuration scheme.
// Docs: N/A
// Official Docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-field-configurations/#api-rest-api-3-fieldconfigurationscheme-project-put
func (f *FieldConfigurationService) Assign(ctx context.Context, fieldConfigurationSchemeID, projectID string) (response *ResponseScheme, err error) {

Map GET /rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/project

Is your feature request related to a problem? Please describe.
Please map the /rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/project endpoint. This endpoint returns a paginated list of projects associated with an issue type screen scheme. Only company-managed projects associated with an issue-type screen scheme are returned.

Describe the solution you'd like
Map this endpoint

Enable the `IssueRemoteLinkService` implementation

Is your feature request related to a problem? Please describe.
Right now, the library doesn't support the ability to manipulate the Jira Remove links

Describe the solution you'd like
Please implement the IssueRemoteLinkService on the Jira V2 and V3 modules.

Describe the tasks needed

  • Create an interface called IssueRemoteLinkConnector
  • Under the interface, create at least methods (Get, Update) with their corresponding documentation (comments).
  • Create a file called remote_links_impl under the jira/internal folder.
  • Create the dedicated go structs under the pkg/infra/models folder.
  • Create a new implementation of the interface (please use the other services as a reference).
  • Create the unit test cases with a minimum of 80% of coverage.
  • On the Client struct located on the api_client_impl.go file, please instance the implementation under the LinkRichTextService and LinkADFService service

image

Additional context

IssueTypeScreenSchemeService: add `description` field when creating issue type screen schemes

Is your feature request related to a problem? Please describe.
The issueTypeScreenSchemeService's CREATE method does not currently support creating an issue type screen scheme with a description.

The method's payload model IssueTypeScreenSchemePayloadScheme is missing a description field.

Describe the solution you'd like
Add a description field to model IssueTypeScreenSchemePayloadScheme .

For example:

type IssueTypeScreenSchemePayloadScheme struct {
	Name              string                                       `json:"name,omitempty"`
        Description       string                                       `json:"description,omitempty"` 
	IssueTypeMappings []*IssueTypeScreenSchemeMappingPayloadScheme `json:"issueTypeMappings,omitempty"`
}

API Reference: Jira Cloud Platform v3 - Issue Type Screen Schemes

Describe alternatives you've considered
NA

Additional context
NA

Filter.Share.SetScope returns a HTTP 415 response

go-atlassian version

v1.1.1

go-atlassian component

  • Jira Software Cloud
  • Jira Agile Cloud
  • Jira Service Management Cloud
  • Confluence Cloud
  • Atlassian Admin Cloud

Describe the bug 🐛

The Filter.Share.SetScope method returns an HTTP 415 when we try to edit the Filter Share scope

bash request failed. Please analyze the request body for more details. Status Code: 415

To Reproduce 🚧

  1. Execute the method

Expected behavior ✅

Edit the Default Filter Share Scope

Screenshots:page_facing_up:

If applicable, add screenshots to help explain your problem.

Additional context

Code snippet

package main

import (
	"context"
	"github.com/ctreminiom/go-atlassian/jira"
	"log"
	"os"
)

func main() {

	var (
		host  = os.Getenv("HOST")
		mail  = os.Getenv("MAIL")
		token = os.Getenv("TOKEN")
	)

	atlassian, err := jira.New(nil, host)
	if err != nil {
		return
	}

	atlassian.Auth.SetBasicAuth(mail, token)

	response, err := atlassian.Filter.Share.SetScope(context.Background(), "GLOBAL")
	if err != nil {
		if response != nil {
			log.Println("Response HTTP Response", string(response.BodyAsBytes))
		}
		log.Fatal(err)
	}

	log.Println("Response HTTP Code", response.StatusCode)
	log.Println("HTTP Endpoint Used", response.Endpoint)
}

Add Ancestor Field when Create content in Confluence

Is your feature request related to a problem? Please describe.
I want to create new page below the parent page

Describe the solution you'd like
Add new Field for Ancestor to create content below its parent page

Additional context
Screen Shot 2021-10-23 at 13 54 14
example of the additional fields for ancestor

Not able to update Issue with issueLinks under

go-atlassian version
Latest

go-atlassian component

  • Jira Software Cloud
  • Jira Agile Cloud
  • Jira Service Management Cloud
  • Confluence Cloud
  • Atlassian Admin Cloud

Describe the bug 🐛

	var payload = models.IssueSchemeV2{
		Fields: &models.IssueFieldsSchemeV2{
IssueLinks: []*models.IssueLinkScheme{
				{
					ID: issueLinkType,
					OutwardIssue: &models.LinkedIssueScheme{
						Key: "AA-1234",
					},
				},
			},
...

resp, err := jiraClient.Issue.Update(ctx, targetKey, false, &payload, &customFields, nil)

Causes "{\"errorMessages\":[],\"errors\":{\"issuelinks\":\"Field does not support update 'issuelinks'\"}}"

Add endpoints to manage Jira statuses

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
Add full CRUD endpoints to manage Jira statuses.

Docs: https://support.atlassian.com/jira-cloud-administration/docs/what-are-issue-statuses-priorities-and-resolutions/#Issue-statuses
API Reference: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-status/#api-group-status

Describe alternatives you've considered
Currently, the library does not provide support for creating/reading/updating/deleting Jira statuses.

Additional context
Add any other context or screenshots about the feature request here.

Enable `/rest/api/3/announcementBanner` endpoints

Is your feature request related to a problem? Please describe.
Right now, the library doesn't support the ability to manipulate the Jira Announcement banners

Describe the solution you'd like
Please implement the AnnouncementBannerService on the Jira V2 and V3 modules.

Describe the tasks needed

  • Create an interface called AnnouncementBannerConnector
  • Under the interface, create two methods (Get, Update) with their corresponding documentation (comments).
  • Create a file called announcement_banner_impl under the jira/internal folder.
  • Create the dedicated go structs under the pkg/infra/models folder.
  • Create a new implementation of the interface (please use the other service as a reference).
  • Create the unit test cases with a minimum of 80% of coverage.

image

Describe the acceptance Criteria

Additional context

Content.Search() results incomplete

go-atlassian version
v1.4.2

go-atlassian component

  • Jira Software Cloud
  • Jira Agile Cloud
  • Jira Service Management Cloud
  • Confluence Cloud
  • Atlassian Admin Cloud

Describe the bug 🐛
Content.Search() does not return fields beyond the title of the content.

To Reproduce 🚧
Copy example code - https://docs.go-atlassian.io/confluence-cloud/content#search-contents-by-cql
Update host, username, password values

Expected behavior
Return pages with values in models.ContentScheme

Actual behavior:
Meeting notes <nil> <nil> <nil> <nil> <nil> [] <nil> <nil> <nil> []}

Additional context
Using Content.Get with an ID works fine.

Code snippet

package main

import (
	"context"
	"github.com/ctreminiom/go-atlassian/confluence"
	"log"
	"net/http"
	"os"
)

func main()  {

	var (
		host  = os.Getenv("HOST")
		mail  = os.Getenv("MAIL")
		token = os.Getenv("TOKEN")
	)

	instance, err := confluence.New(nil, host)
	if err != nil {
		log.Fatal(err)
	}

	instance.Auth.SetBasicAuth(mail, token)
	instance.Auth.SetUserAgent("curl/7.54.0")

	var (
		cql = "type=page"
		cqlContext = ""
		expand = []string{"childTypes.all", "metadata.labels"}
		maxResults = 50
	)

	contentPage, response, err := instance.Content.Search(context.Background(), cql, cqlContext, expand, "", maxResults)
	if err != nil {

		if response.Code == http.StatusBadRequest {
			log.Println(response.API)
		}
		log.Fatal(err)
	}

	log.Println("Endpoint:", response.Endpoint)
	log.Println("Status Code:", response.Code)
	log.Println(contentPage.Links.Next)


	for _, content := range contentPage.Results {
		log.Printf("%v", content)
	}
}

Add Confluence V2 Get Children

Is your feature request related to a problem? Please describe.
Would love to be able to use the V2 API to retrieve child pages of Confluence pages.

Describe the solution you'd like
I would like some way that isn't resorting to the old Content form of API to get children of Confluence pages. Maybe an addition to the PageService.

Describe alternatives you've considered
Using the V1 API then making a call against V2 API for each ID returned...

Additional context
N/A

🧾 Enable the ability to download Jira attachments

Is your feature request related to a problem? Please describe.
Map the endpoint documented on the following link
Describe the solution you'd like
Add the Download method on the IssueAttachmentService

Describe alternatives you've considered
N/A

Additional context
Add any other context or screenshots about the feature request here.

Support Confluence Page Movement

Is your feature request related to a problem? Please describe.
The v1 API supports the PUT /wiki/rest/api/content/{pageId}/move/{position}/{targetId} which will move a page in the hierarchy from one position to another.

Describe the solution you'd like
Add Move() method to internal.ChildrenDescandantsService.

Describe alternatives you've considered
None, this seems like the right place for it.

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.