Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The User.Find method does not parse the query param #43

Closed
ctreminiom opened this issue May 24, 2021 · 0 comments
Closed

The User.Find method does not parse the query param #43

ctreminiom opened this issue May 24, 2021 · 0 comments
Assignees
Labels
bug Something isn't working Jira Software Cloud
Projects

Comments

@ctreminiom
Copy link
Owner

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)
	}

}
@ctreminiom ctreminiom added bug Something isn't working Jira Software Cloud labels May 24, 2021
@ctreminiom ctreminiom self-assigned this May 24, 2021
@ctreminiom ctreminiom added this to To do in Roadmap via automation May 24, 2021
ctreminiom added a commit that referenced this issue May 24, 2021
Roadmap automation moved this from To do to To Release May 24, 2021
@ctreminiom ctreminiom moved this from To Release to Released in Roadmap Jul 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Jira Software Cloud
Projects
Archived in project
Roadmap
Released
Development

No branches or pull requests

1 participant