I submitted a new job via GUI and then replicated the exact same JSON
with a REST call. The result is not the same unfortunately, the new job
is missing SCM and polling information but has slave label and build
command stored successfully.

I am calling Jenkins with basic authentication and www-urlencoded form
data with json in a field "json". I am guessing that scm and polling are
not being saved via json and I need to include the full form data aswell?

Best regards, cen

JSON recorded from GUI http request:*{
        blockBuildWhenDownstreamBuilding:false,
        blockBuildWhenUpstreamBuilding:false,
        builder:{
                '':'ls',
                $class:'hudson.tasks.Shell',
                command:'ls',
                'stapler-class':'hudson.tasks.Shell'
        },
        concurrentBuild:false,
        'core:apply':'',
        customWorkspace:'',
        description:'',
        disable:false,
        displayNameOrNull:'',
        hasCustomQuietPeriod:false,
        hasCustomScmCheckoutRetryCount:false,
        hasCustomWorkspace:false,
        hasSlaveAffinity:true,
        'hudson-triggers-SCMTrigger':{
                ignorePostCommitHooks:false,
                scmpoll_spec:'*****'
        },
        label:'cb79c0f4d8afad287c0cfc982681f1f3 
<label:%27cb79c0f4d8afad287c0cfc982681f1f3>',
        name:'comon',
        properties:{
                'com-coravy-hudson-plugins-github-GithubProjectProperty':{},
                'hudson-model-ParametersDefinitionProperty':{
                        specified:false
                },
                'jenkins-branch-RateLimitBranchProperty$JobPropertyImpl':{},
                'jenkins-model-BuildDiscarderProperty':{
                        '':'0',
                        specified:false,
                        strategy:{
                                $class:'hudson.tasks.LogRotator',
                                artifactDaysToKeepStr:'',
                                artifactNumToKeepStr:'',
                                daysToKeepStr:'',
                                numToKeepStr:'',
                                'stapler-class':'hudson.tasks.LogRotator'
                        }
                },
                'stapler-class-bag':'true'
        },
        quiet_period:'5',
        scm:{
                '':'auto',
                branches:{
                        name:'*/master'
                },
                userRemoteConfigs:{
                        credentialsId:'',
                        name:'',
                        refspec:'',
                        url:'https://github.com/cen1/helloworld.git 
<https://github.com/cen1/helloworld.git>'
                },
                value:'1'
        },
        scmCheckoutRetryCount:'0'
}
*

My replicated JSON sent by rest client:*{
        blockBuildWhenDownstreamBuilding:false,
        blockBuildWhenUpstreamBuilding:false,
        builder:{
                '':'ls',
                $class:'hudson.tasks.Shell',
                command:'ls',
                'stapler-class':'hudson.tasks.Shell'
        },
        concurrentBuild:false,
        'core:apply':'',
        customWorkspace:'',
        description:'',
        disable:false,
        displayNameOrNull:'',
        hasCustomQuietPeriod:false,
        hasCustomScmCheckoutRetryCount:false,
        hasCustomWorkspace:false,
        hasSlaveAffinity:true,
        'hudson-triggers-SCMTrigger':{
                ignorePostCommitHooks:false,
                scmpoll_spec:'*****'
        },
        label:'c177fc6a48acb6d709580ad08da45f68 
<label:%27c177fc6a48acb6d709580ad08da45f68>',
        name:'8ab5040f-8e18-4588-9245-1a2bdee3a6fe',
        properties:{
                'com-coravy-hudson-plugins-github-GithubProjectProperty':{},
                'hudson-model-ParametersDefinitionProperty':{
                        specified:false
                },
                'jenkins-branch-RateLimitBranchProperty$JobPropertyImpl':{},
                'jenkins-model-BuildDiscarderProperty':{
                        '':'0',
                        specified:false,
                        strategy:{
                                $class:'hudson.tasks.LogRotator',
                                artifactDaysToKeepStr:'',
                                artifactNumToKeepStr:'',
                                daysToKeepStr:'',
                                numToKeepStr:'',
                                'stapler-class':'hudson.tasks.LogRotator'
                        }
                },
                'stapler-class-bag':'true'
        },
        quiet_period:'5',
        scm:{
                '':'auto',
                branches:{
                        name:'*/master'
                },
                userRemoteConfigs:{
                        credentialsId:'',
                        name:'',
                        refspec:'',
                        url:'https://github.com/cen1/helloworld.git 
<https://github.com/cen1/helloworld.git>'
                },
                value:'1'
        },
        scmCheckoutRetryCount:'0'
}*


The 'hudson-triggers-SCMTrigger' and 'scm' properties are not being
saved by Jenkins.


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/85fd4bd4-6b0d-4dcf-a2fd-c2e5aa85c9dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to