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

DeclinePullRequest is throwing 405 error #7

Closed
nikitha789 opened this issue Oct 4, 2018 · 1 comment
Closed

DeclinePullRequest is throwing 405 error #7

nikitha789 opened this issue Oct 4, 2018 · 1 comment
Assignees
Labels

Comments

@nikitha789
Copy link

nikitha789 commented Oct 4, 2018

While using DeclinePullrequest Method,it is failing with status code 405.

FlurlHttpException: DELETE http://bitbucket.org/rest/api/1.0/projects/{projectkey}/repos/{slug}/pull-requests/1898/decline?version=2 failed with status code 405 ().

This is the method I have defined using the bitbucket package

`public bool DeclineUnapprovedBuildMasterPullRequests()
{
var openBuildMasterUnapprovedPullRequests = GetOpenBuildMasterPullRequests().Where(pr=> pr.Reviewers.Count(rev => rev.Approved) <PULL_APPROVAL_THRESHOLD).ToList();

        if (openBuildMasterUnapprovedPullRequests.Count > 0)
        {
            foreach (var pullRequest in openBuildMasterUnapprovedPullRequests)
            {
                
                var declinePullRequest = bitbucketClient.DeclinePullRequestAsync(settings.ProjectKey, settings.RepositorySlug, pullRequest.Id, pullRequest.Version).Result;
                if (!declinePullRequest)
                    return false;
            }
        }

        return true;
    }

`

@lvermeulen lvermeulen added the bug label Oct 5, 2018
@lvermeulen
Copy link
Owner

I'm using the wrong verb there, fixed in release 2.1.3

@lvermeulen lvermeulen self-assigned this Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants