How to call a Jenkins job present in some folder?

Asked by Taher

Hello all,
I have a jenkins job "test_project" created in folder "test_jobs".
I want to fire this job using python-jenkins build_job() function. But it is giving me the error.
I am calling function like this :

$ import jenkins
$ j = jenkins.Jenkins(url,username,password)
$ j.build_job('test_jobs/test_project')

Error :
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/jenkins/__init__.py", line 593, in disable_job
    b''))
  File "/usr/local/lib/python2.7/dist-packages/jenkins/__init__.py", line 333, in jenkins_open
    raise NotFoundException('Requested item could not be found')
jenkins.NotFoundException: Requested item could not be found

Thank you in advance.

Question information

Language:
English Edit question
Status:
Expired
For:
Python Jenkins Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Taher (taher-bohari) said :
#1

I have tried it like this way too :

$ j.build_job("test_project")

But getting same error.

Revision history for this message
Taher (taher-bohari) said :
#2

Hello All,

I resolved the error. I need to call the job like
$ j.build_job('test_jobs/job/test_project')

Thanks.

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.