How to trigger job (circle v2.0) from command line


I wanna start circle job(v 2.0) from other circle job(v 2.0).

I try to use curl -X POST --header “Content-Type:application/json”

But on circleci job I have error:

Build-agent version 0.0.7288-1e94a694 (2018-07-06T16:07:08+0000)
Configuration errors: 1 error occurred:

  • Cannot find a job named build to run in the jobs: section of your configuration file.
    If you expected a workflow to run, check your config contains a top-level key called ‘workflows:’

Using ‘api/v2’ and ‘api/v2.0’ can’t help.

regarding this I have question: Is it possible to run on circle job (v 2) form other job (v 2) or its solution only for v1.1???

My config like this:

version: 2
      xcode: "9.4.0"
  version: 2
        - all-tests


My guess is that since you are triggering a job and not a workflow via the API, the job has to be called “build”, otherwise it would not know which job to call.


Yes!!! it’s working after specify job name for run (CIRCLE_JOB)

 curl -X POST --header "Content-Type:application/json" --data '{"build_parameters": {"CIRCLE_JOB": "all-tests"}}' 


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.