question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Job api to create jobs inside a folder

See original GitHub issue

Currently, the job Api to create a job is as follows

https://github.com/cdancy/jenkins-rest/blob/e17624716ace749dd7865601bda6648a801198bf/src/main/java/com/cdancy/jenkins/rest/features/JobsApi.java#L73-L82

This API creates a job in jenkins root folder but not inside a folder.

Perhaps, we can add another API to with a pathparam like @Path("{pathToJob}/createItem") to support the creation of jobs inside a folder.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
martindacommented, May 4, 2018

Great idea. I need this too. Thanks @Dhivyaa21 and @cdancy

1reaction
Dhivyaa21commented, May 3, 2018

@cdancy This looks good. I am adding tests to this change. Meanwhile, a quick question. Do you think its a good idea to use this OPTIONAL_FOLDER_PATH_PARAM for all the job APIs? i am not sure if the other job APIs were designed to access jobs in a folder.

Right now we squeeze in the path to job in the {name} path parameter of other APIs. It works fine. It was just the create API that did not have a way to create the job in a folder. Hence, I created this issue.

Example - Say I want to disable a job in the following path

“/job/folder/job/testJob”

Disable job api is https://github.com/cdancy/jenkins-rest/blob/e17624716ace749dd7865601bda6648a801198bf/src/main/java/com/cdancy/jenkins/rest/features/JobsApi.java#L131-L136

To disable the job , I’ll have to call api().disable("folder/job/testJob") and not api().disable("testJob").

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a job in Jenkins (or folder) using the HTTP API · GitHub
Create a job in Jenkins (or folder) using the HTTP API - CreateJob.sh.
Read more >
Jenkins api create job in a folder - Google Groups
I'm using the scriptler plugin to write a groovy script using the Jenkins api, that will clone a set of jobs. With jenkins.model.Jenkins....
Read more >
Create a job in Jenkins (or folder) using the HTTP API
We empower you and your team to get more done, faster · Create a job in Jenkins (or folder) using the HTTP API....
Read more >
How to create a job using the REST API and cURL?
First, create a job using the UI. This job can be used to create a base config that can be used to create...
Read more >
(In Jenkins) How to build job which is inside folder using ...
I moved job "BuildThemAll" to root of Jenkins. This way, I could trigger using API. Now in configuration of this job, I kept...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found