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

Next challenges

Recent achievements

Recognition

  • Give kudos
  • My kudos

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

5 mobile apps for Jira Cloud to boost productivity

  It’s very important to have access to the workflow process from anywhere. Especially if you manage the work of others. There is no difference whether you’re out of office, or drive a ca...

284 views 2 5
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