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

Add method for get priority schema by project ID #661

Open
yongDataScince opened this issue Feb 28, 2024 · 0 comments
Open

Add method for get priority schema by project ID #661

yongDataScince opened this issue Feb 28, 2024 · 0 comments

Comments

@yongDataScince
Copy link

// PriorityScheme represents a scheme for same project
// The 'OptionIDs' field stores the priority IDs of a specific project
type PriorityScheme struct {
	ID              int      `json:"id"`
	Name            string   `json:"name"`
	Description     string   `json:"description"`
	DefaultOptionID string   `json:"defaultOptionId"`
	OptionIDs       []string `json:"optionIds"`
}

func (s PriorityService) GetPriorityScheme(ctx context.Context, projectID string) (*PriorityScheme, *Response, error) {
	apiEndpoint := fmt.Sprintf("rest/api/2/project/%s/priorityscheme", projectID)
	req, err := s.client.NewRequest(ctx, "GET", apiEndpoint, nil)
	if err != nil {
		return nil, nil, err
	}

	priorityScheme := new(PriorityScheme)
	resp, err := s.client.Do(req, priorityScheme)
	if err != nil {
		return nil, nil, NewJiraError(resp, err)
	}
	return priorityScheme, resp, nil
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant