Skip to content

jobsApi config/create method misses "+" in <command> tag #330

@ozvale

Description

@ozvale

parts of jobXml content:

<builders>
        <hudson.tasks.Shell>
            <command>set +x
                bash -c &quot;${shell}&quot;</command>
        </hudson.tasks.Shell>
</builders>

when i called client.api().jobsApi().config(null, jobName, jobXml)) or client.api().jobsApi().create(null, jobName, jobXml))
"+" in command tag will be replace to " "
jenkins job build execute shell:

set   x
bash -c "${shell}"

i try to send a similar request with postman,it is correct.

Expected Behavior

jobXml command tag content support "+" for creating or updating

Current Behavior

see jenkins job build shell below

set   x
bash -c "${shell}"

"+" is missing

Context

when i called client.api().jobsApi().config(null, jobName, jobXml)) or client.api().jobsApi().create(null, jobName, jobXml))
"+" in tag will be replace to " "

Steps to Reproduce (for bugs)

  • create a job by jenkins page,set build->execute shell-> set +x
  • call client.api().jobsApi().config(null, jobName)) get jobXml,"+" exists in command tag
  • call client.api().jobsApi().config(null, jobName, jobXml),see jenkins server config page ,"+" is missing

Your Environment

Jenkins Server 2.199

 <dependency>
            <groupId>io.github.cdancy</groupId>
            <artifactId>jenkins-rest</artifactId>
            <version>1.0.2</version>
 </dependency>

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions