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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,335
Community Members
 
Community Events
176
Community Groups

P4java connect to server with ticket

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. 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events