Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I get the current file during a bitbucket pull-request.

Mike Delaney July 8, 2017

All,

I'm writing a plugin for BitBucket Server, that is displayed during a pull-request on the review/diff view. As part of this, I'd like to know what file the developer/reviewer is currently looking at.  Does anyone know how to look up the current active file?

I looked through the Developer docs and couldn't find any points of reference to help figure this out.

- Mike D.

1 answer

0 votes
Mike Delaney July 9, 2017

I think I was able to figure this out, albeit this might not be the best solution.

Within JavaScript, I was able to get the file and fullPath via the following lines:

var filePath =  require('bitbucket/internal/model/page-state').getFilePath();
var fullPath = filePath.attributes.components.join('/');

- Mike D.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events