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

Cannot create jobs inside folders #865

Open
GratielaM opened this issue Oct 29, 2024 · 0 comments
Open

Cannot create jobs inside folders #865

GratielaM opened this issue Oct 29, 2024 · 0 comments

Comments

@GratielaM
Copy link

GratielaM commented Oct 29, 2024

ISSUE TYPE
  • Bug Report
  • Feature Idea
  • How to...
Jenkinsapi VERSION: 0.3.13
Jenkins VERSION: 2.462.3
SUMMARY

Creating jobs inside a given folder fails. create_job method works only for creating jobs in main folder.
E.g.:
create_job(jobname=folder1/folder2/job-name, xml=config_xml)

  • folder1 and folder2 were already created when I call create_job method
  • I also tried with job_name=/job/folder1/job/folder2/job-name but it didn't work.
EXPECTED RESULTS
  • Job must be created successfully
ACTUAL RESULTS
  • Creating job fails with jenkinsapi.custom_exceptions.JenkinsAPIException: Operation failed error.
    Traceback (most recent call last): File "/home/gratiela/automation/Git/jenkins_python_api/jobs.py", line 131, in <module> job_object.create_job_in_folder("folder1/folder2", "test", config_xml) File "/home/gratiela/automation/Git/jenkins_python_api/jobs.py", line 101, in create_job_in_folder job = self.server.create_job(full_job_path, config_xml) File "/home/gratiela/.local/lib/python3.8/site-packages/jenkinsapi/jenkins.py", line 199, in create_job return self.jobs.create(jobname, xml) File "/home/gratiela/.local/lib/python3.8/site-packages/jenkinsapi/jobs.py", line 163, in create self.jenkins.requester.post_xml_and_confirm_status( File "/home/gratiela/.local/lib/python3.8/site-packages/jenkinsapi/utils/requester.py", line 193, in post_xml_and_confirm_status return self.post_and_confirm_status( File "/home/gratiela/.local/lib/python3.8/site-packages/jenkinsapi/utils/requester.py", line 217, in post_and_confirm_status raise JenkinsAPIException( jenkinsapi.custom_exceptions.JenkinsAPIException: Operation failed. url=http://jenkins.npunix.bitdefender.biz:8080/createItem?name=folder1%2Fjob%2Ffolder2%2Fjob%2Ftest, data=<?xml version='1.1' encoding='UTF-8'?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant