Jenkins Pipeline and stash Pull Request Builder not working on PR create/update
To expand on the answer above - try using:

branch: "origin/pr/${pullRequestId}/from"


Because in groovy, string interpolation is not done for simple strings - i.e. strings within single quotes. See http://groovy-lang.org/syntax.html#_string_interpolation for details on that.