Hello. I am trying to retrieve a pull request url and I saw the NavBuilder interface would be useful for that. I’m struggling to instantiate a class that implements this interface though.
I imported the bitbucket-server-api and spi packages in my pom.xml. I’m probably not giving enough information because I’m new developing bitbucket-plugins.
I’ll provide a code snippet so that you understand my idea.
String content = String.format(“Branch "%s" was merged into branch "%s" at %s. Details at %s”, fromBranch, toBranch, event.getDate().toString(), url);
I’d set the url with the buildAbsolute() for the specific pullRequest.
I tried using
@ComponentImport
NavBuilder nb;
or
@Autowired
NavBuilder nb;
But none of them worked. There were exceptions telling me no bean implementing NavBuilder was available.
What are the steps to be followed to obtain an instance of NavBuilder or its nested classes (e.g. NavBuilder.PullRequestOverview, …)?