Hello, I'm using scriptrunner in my jira software. In my listener I wrote sample groovy code, where I want to connect to perforce server with ticket. Here is my code:
String p4url = "perforce:1666"
final String p4hosturl = ServerFactory.DEFAULT_PROTOCOL_NAME + "://" + p4url
IServer server = ServerFactory.getServer(p4hosturl, null)
AuthTicket auth = AuthTicketsHelper.getTicket(p4url, server.getTicketsFilePath())
if (auth == null) {
log.info("log in")
server.connect()
server.setUserName(p4User)
server.login(p4Passwd)
return server
} else {
log.info("ticket")
server.connect()
server.setAuthTicket(auth)
return server
}
In case where auth is null works perfectly, but when I want to connect to server using ticket, it gave me:
Perforce password %P4PASSWD% invalid or unset.
Time to up your Loom game! The new Loom Essentials Certification is here! Show off your skills, learn pro tips, and get officially recognized. Perfect for taking your video messaging to the next level.
Learn moreOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.