No output on console

Daniel Burke February 1, 2018

Can anybody help me as to why the Bitbucket script runner will not log anything with those code:

import com.atlassian.bitbucket.*;
import com.atlassian.bitbucket.user.ApplicationUser;
import com.atlassian.bitbucket.user.UserService;
import com.atlassian.bitbucket.user.Person
import com.atlassian.sal.api.component.ComponentLocator;
import com.atlassian.bitbucket.user.UserAdminService
import com.atlassian.bitbucket.project.ProjectSupplier
import com.atlassian.bitbucket.project.ProjectService
import com.atlassian.bitbucket.auth.AuthenticationContext
import org.apache.log4j.Level
import org.apache.log4j.Logger

def UserService userService = ComponentLocator.getComponent(UserService);


log.debug "foo bar"

//File to be written to, can be CSV or TXT
//File file = new File("/local/home/rbadmin_app2/output.txt")

def ProjectService projectService

def projectName = projectService.findAll()
def bitbucketUser = userService.getUserByName("");

for(Iterator<String> iterator = bitbucketUser.iterator(); iterator.hasNext();){
return iterator.next()
log.error iterator

}
for(int i = 0; i <= projectName.size(); i ++){
return "" + projectName
log.error projectName

}


 It will not write to a file (Even though it exists) nor print to the console. Please help!

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events