-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major
-
Component/s: p4-plugin
-
None
-
Environment:Jenkins Version 2.541.1
P4 Plugin 1.17.2
According to P4 for Jenkins DocumentationĀ 1.17.x :

So, setting up perforce to send that 'Perforce Change JSON payload' should work for triggering builds.
But when using a Multibranch pipeline based on 'Helix Swarm' branches, that payload will create undesired branches unrelated to the the ones set up on Swarm.
This part of the code in SwarmScmSource.java, for unknown reasons, will use P4BranchScanner to try to guess a branch name. If you're lucky, it will match whatever you've named it on swarm, otherwise, it will just spawn a new one based on that name.
Seems like the manual is suggesting unsupported usage and the code is trying to guess something it simply cannot.
It would arguably make more sense to:
1 - Fail here:
if (project == null || !project.equalsIgnoreCase(getProject()))
2- Or maybe rely on SwarmHelper to figure out the info it will need (SWARM_PROJECT, SWARM_BRANCH, SWARM_PATH...)
Either way, that 'branch guessing' should probably go.