Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ozvale opened this issue Feb 27, 2024 · 2 comments
Open

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

ozvale opened this issue Feb 27, 2024 · 2 comments
Assignees
Labels

Comments

@ozvale
Copy link

ozvale commented Feb 27, 2024

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>
@zk279444107
Copy link

zk279444107 commented Mar 26, 2024

& -> &amp;
+ -> %2B

@cdancy
Copy link
Owner

cdancy commented Mar 26, 2024

@ozvale @zk279444107 I'd be open for someone sending in a PR to fix this as at the moment I simply do not have the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants