public void addPullRequestReviewer(String project,String repository,String pullRequestId,String user,StashClient stashClient){
  try {
    StashPullRequest pullRequest=stashClient.getPullRequest(project,repository,pullRequestId);
    StashUser reviewer=pullRequest.getReviewer(user);
    if (reviewer == null) {
      ArrayList<StashUser> reviewers=new ArrayList<>(pullRequest.getReviewers());
      reviewers.add(stashClient.getUser(user));
      stashClient.addPullRequestReviewer(project,repository,pullRequestId,pullRequest.getVersion(),reviewers);
      LOGGER.info("User \"{}\" is now a reviewer of the pull-request {} #{}",user,pullRequestId,project,repository);
    }
  }
 catch (  StashClientException e) {
    LOGGER.error("Unable to add a new reviewer to the pull-request",e);
  }
}

public void addPullRequestReviewer ( String project , String repository , String pullRequestId , String user , StashClient stashClient ) { try { StashPullRequest pullRequest = stashClient . getPullRequest ( project , repository , pullRequestId ) ; StashUser reviewer = pullRequest . getReviewer ( user ) ; if ( reviewer == null ) { ArrayList < StashUser > reviewers = new ArrayList < > ( pullRequest . getReviewers ( ) ) ; reviewers . add ( stashClient . getUser ( user ) ) ; stashClient . addPullRequestReviewer ( project , repository , pullRequestId , pullRequest . getVersion ( ) , reviewers ) ; LOGGER . info ( "User \"{}\" is now a reviewer of the pull-request {} #{}" , user , pullRequestId , project , repository ) ; } } catch ( StashClientException e ) { LOGGER . error ( "Unable to add a new reviewer to the pull-request" , e ) ; } }
add a reviewer to the current pull - request .
