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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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
Community showcase
Published in Marketplace Apps & Integrations

🤺 Atlympic Event: Partnerships

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

108 views 0 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you