I have succeeded to trigger Freestyle project, but I couldn't trigger pipelile project when 'Perforce Triggered Build' is checked.

          [JENKINS-70597] perforce plugin doesn't trigger Pipline project

          Aram created issue -
          Karl Wirth made changes -
          Labels New: P4_SUPPORT

          Karl Wirth added a comment -

          Karl Wirth added a comment - Hi hovhannisyan   I think for multibranch you now need to use the p4/event endpoint:     https://www.perforce.com/manuals/jenkins/Content/P4Jenkins/multibranch-pipeline-setup.html?Highlight=event#MultiBranch_trigger_SCM_events   Regards, Karl
          Karl Wirth made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Karl Wirth made changes -
          Assignee New: Karl Wirth [ p4karl ]

          Praveen Lobo added a comment - - edited

          You are correct in saying that the multibranch pipeline uses p4/event endpoint. However, OP is asking about Pipeline job

          I'm able to trigger a freestyle job using p4/change endpoint.

          I'm able to trigger a multibranch pipeline using p4/event endpoint.

          Similar to OP, I'm unable to trigger a Pipeline job (Pipeline script from SCM setup) using either of those endpoints. 

           

          All these projects use the same Perforce server and the same credential. 

           

          I can see the pipeline job (test_p4_trigger_pipeline) {}mentioned in the Jenkins logs but it doesn't trigger it. I also don't see {{P4: poking:... }}for this pipeline. 

          ...

          INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange
          Received trigger event for: <P4PORT>
          ...
          INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs
          P4: probing: test_p4_trigger_pipeline
          ...

           

          Praveen Lobo added a comment - - edited You are correct in saying that the multibranch pipeline uses p4/event endpoint. However, OP is asking about Pipeline job I'm able to trigger a freestyle job using p4/change endpoint. I'm able to trigger a multibranch pipeline using p4/event endpoint. Similar to OP, I'm unable to trigger a  Pipeline job ( Pipeline script from SCM setup ) using either of those endpoints.    All these projects use the same Perforce server and the same credential.    I can see the pipeline job ( test_p4_trigger_pipeline) { }mentioned in the Jenkins logs but it doesn't trigger it. I also don't see {{P4: poking:... }}for this pipeline.  ... INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange Received trigger event for: <P4PORT> ... INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs P4: probing: test_p4_trigger_pipeline ...  
          Karl Wirth made changes -
          Attachment New: image-2023-06-08-15-38-25-709.png [ 60568 ]

          Karl Wirth added a comment -

          Hi lobopraveen - Thanks for the confirmation.

          What version of Jenkins and P4Plugin are you using?

          For me this works:

          curl --user perforce:110143578ecaf3ad76bde7bad656d1b9a5 --header 'Content-Type: application/json' --request POST --data "payload={change:200,p4port:\"localhost:1666\"}" http://192.168.1.128:8080/p4/change 

          And triggers my pipeline job that is defined as:

          The script I am using is:

          pipeline {
            agent any
                   }
            stages {
              stage("Test") {
                steps {
                  script {
                      echo "In script."
                      checkout perforce(credential: 'JenkinsMaster', populate: autoClean(delete: true, modtime: false, parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: true, replace: true, tidy: false), workspace: manualSpec(charset: 'none', name: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}', pinHost: false, spec: clientSpec(allwrite: false, backup: false, clobber: true, compress: false, line: 'LOCAL', locked: false, modtime: false, rmdir: false, serverID: '', streamName: '', type: 'WRITABLE', view: '//depot/project1/main/... //${P4_CLIENT}/...')))
                      sh 'ls'  
                  }
                }
              }
            }
          } 

          In the Jenkins log I see:

          Received trigger event for: localhost:1666
          Jun 08, 2023 2:34:25 PM FINE org.jenkinsci.plugins.p4.trigger.P4HookP4: trying: GroovyIntegTest
          Jun 08, 2023 2:34:25 PM FINE org.jenkinsci.plugins.p4.trigger.P4HookP4: trigger not set: GroovyIntegTest
          Jun 08, 2023 2:34:25 PM FINE org.jenkinsci.plugins.p4.trigger.P4Hoo
          P4: probing: TriggeredBuild
          Jun 08, 2023 2:34:25 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger pokeP4: poking: TriggeredBuild
          Jun 08, 2023 2:34:25 PM FINER org.jenkinsci.plugins.p4.PerforceScmP4: 

          I am using Jenkins Jenkins 2.387.3 and p4-plugin 1.14.1.

           

          Can you see how your test differs to mine?

           

           

          Karl Wirth added a comment - Hi lobopraveen - Thanks for the confirmation. What version of Jenkins and P4Plugin are you using? For me this works: curl --user perforce:110143578ecaf3ad76bde7bad656d1b9a5 --header 'Content-Type: application/json' --request POST --data "payload={change:200,p4port:\" localhost:1666\ "}" http: //192.168.1.128:8080/p4/change And triggers my pipeline job that is defined as: The script I am using is: pipeline {   agent any }   stages {     stage( "Test" ) {       steps {         script {             echo "In script."             checkout perforce(credential: 'JenkinsMaster' , populate: autoClean(delete: true , modtime: false , parallel: [enable: false , minbytes: '1024' , minfiles: '1' , threads: '4' ], pin: '', quiet: true , replace: true , tidy: false ), workspace: manualSpec(charset: ' none ', name: ' jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER} ', pinHost: false , spec: clientSpec(allwrite: false , backup: false , clobber: true , compress: false , line: ' LOCAL ', locked: false , modtime: false , rmdir: false , serverID: ' ', streamName: ' ', type: ' WRITABLE ', view: ' //depot/project1/main/... //${P4_CLIENT}/...')))             sh 'ls'           }       }     }   } } In the Jenkins log I see: Received trigger event for : localhost:1666 Jun 08, 2023 2:34:25 PM FINE org.jenkinsci.plugins.p4.trigger.P4HookP4: trying: GroovyIntegTest Jun 08, 2023 2:34:25 PM FINE org.jenkinsci.plugins.p4.trigger.P4HookP4: trigger not set: GroovyIntegTest Jun 08, 2023 2:34:25 PM FINE org.jenkinsci.plugins.p4.trigger.P4Hoo P4: probing: TriggeredBuild Jun 08, 2023 2:34:25 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger pokeP4: poking: TriggeredBuild Jun 08, 2023 2:34:25 PM FINER org.jenkinsci.plugins.p4.PerforceScmP4: I am using Jenkins Jenkins 2.387.3 and p4-plugin 1.14.1.   Can you see how your test differs to mine?    
          Ashish made changes -
          Attachment New: image-2023-06-09-15-32-07-170.png [ 60576 ]

          Ashish added a comment -

          Hi p4karl - We are using Jenkins version 2.375.4.2-rolling and p4-plugin version 1.14.1. We can trigger a Freestyle job using below curl cmd; however unable to trigger a regular pipeline job using the same cmd. The screenshot below is for the pipeline job.

          curl --header 'Content-Type: application/json' --user <user>:<pwd> --request POST --data "payload={change:200,p4port:\"<P4PORT>"}" https://<JenkinsUrl>/xxxx/p4/change

          Ashish added a comment - Hi p4karl - We are using Jenkins version 2.375.4.2-rolling and p4-plugin version 1.14.1. We can trigger a Freestyle job using below curl cmd; however unable to trigger a regular pipeline job using the same cmd. The screenshot below is for the pipeline job. curl --header 'Content-Type: application/json' --user <user>:<pwd> --request POST --data "payload={change:200,p4port:\"<P4PORT>"}" https://<JenkinsUrl>/xxxx/p4/change

            p4karl Karl Wirth
            hovhannisyan Aram
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: