The Perforce plugin does not substitute all variables when polling for changes. I use variables in the following fields: "Workspace (client)" and "View Map".
The plugin replaces only the variable ${JOB_NAME} with the correct value, but ignores ${NODE_NAME} and ${USERNAME} (and perhaps some other variables too). Using %USERNAME% instead of ${USERNAME} does not work.
The polling log looks like:
Started on 14.08.2012 16:36:33
Looking for changes...
Using node: Jenkins
Using master perforce client: ${USERNAME}admin.test${NODE_NAME}
[JENKINS_HOME] $ "c:\Program Files\P4\p4.exe" workspace -o ${USERNAME}admin.test${NODE_NAME}
[JENKINS_HOME] $ "c:\Program Files\P4\p4.exe" counter change
[JENKINS_HOME] $ "c:\Program Files\P4\p4.exe" -s changes -s submitted //${USERNAME}admin.test
/...@26326,@26325
No changes found.
When I do not use polling (starting the job manually), the plugin has no problem to create and sync the workspace.
What is USERNAME supposed to be set to? That's not a standard Jenkins environment variable.