Skip to content

Add job create command #169

@tiulpin

Description

@tiulpin

Area: Configuration (parameters, projects)

Problem or use case

The CLI has CreateBuildType and CreateBuildStep API methods (api/interface.go) but no corresponding CLI commands. AI agents following Journey 2 (set up CI) need to create build configurations as part of the initial pipeline setup, and currently must use raw API calls:

# Current workaround
teamcity api '/app/rest/buildTypes' -X POST -f 'name=Build' -f 'projectId=MyProject'

This is a critical gap for both Journey 2 (new developer onboarding) and Journey 5 (build engineer adding new jobs).

Proposed solution

teamcity job create <name> --project <project-id>                    # Basic job
teamcity job create <name> --project <project-id> --id CustomId      # Explicit ID
teamcity job create <name> --project <project-id> --template <id>    # From template

Output:

✓ Created job "Build" (id: MyProject_Build) in project "MyProject"
  URL: https://teamcity.example.com/buildConfiguration/MyProject_Build

Flags

  • --project, -p (required) — parent project ID
  • --id — explicit build configuration ID
  • --template — create from an existing template
  • --json — machine-readable output
  • -w, --web — open in browser after creation

API

Uses existing methods in api/interface.go:

CreateBuildType(projectID string, req CreateBuildTypeRequest) (*BuildType, error)
POST /app/rest/buildTypes

Alternatives considered

  • Only support job creation via versioned settings / Kotlin DSL — doesn't work for the quick onboarding case where a developer doesn't have DSL set up yet
  • Combine with project create in a single init command — too opinionated; these should be composable primitives

Contribution

  • I'd be willing to submit a PR for this feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:configConfiguration management (parameters, DSL, cleanup)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions