Coder Social home page Coder Social logo

How do I get the last pull request from the master? to avoid the problem I'm having slow. method used: .GetPullRequestLog () about sharpbucket HOT 2 CLOSED

mitjabezensek avatar mitjabezensek commented on August 11, 2024
How do I get the last pull request from the master? to avoid the problem I'm having slow. method used: .GetPullRequestLog ()

from sharpbucket.

Comments (2)

mnivet avatar mnivet commented on August 11, 2024

You should do that using a query filter and a sort instruction on the ListPullRequests(ListParameters parameters) method

you can refer to the Bitbucket documentation about filtering and sorting to build your filter and sort strings: https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering

It should looks like that:

var branchName = "master";
var parameters = new ListParameters
{
Filter = $"destination.branch.name = \"{branchName}\"",
Sort = "-updated_on", /* or "-created_on"  in function of what you mean by last */
Max = 1 /* since you are not interested to get all */
};
var lastPullRequest = pullRequestsResource.ListPullRequests(parameters).FirstOrDefault();

from sharpbucket.

tiago-mateus avatar tiago-mateus commented on August 11, 2024

Obrigadoo!

from sharpbucket.

Related Issues (20)

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.