Skip to content

feat: add Jobs.getById method#330

Closed
ninja-shreyash wants to merge 6 commits intomainfrom
feat/sdk-plt-100298
Closed

feat: add Jobs.getById method#330
ninja-shreyash wants to merge 6 commits intomainfrom
feat/sdk-plt-100298

Conversation

@ninja-shreyash
Copy link
Copy Markdown
Contributor

@ninja-shreyash ninja-shreyash commented Mar 26, 2026

Method Added

Layer Method Signature
Service jobs.getById() getById(id: number, options?: JobGetByIdOptions): Promise<JobGetResponse>

Endpoint Called

Method HTTP Endpoint OAuth Scope
getById() GET /odata/Jobs({id}) OR.Jobs or OR.Jobs.Read
  • Extends FolderScopedService — optionally sets X-UIPATH-OrganizationUnitId header when folderId is provided
  • Supports OData query options ($expand, $select)

Example Usage

import { UiPath } from '@uipath/uipath-typescript/core';
import { Jobs } from '@uipath/uipath-typescript/jobs';

const sdk = new UiPath(config);
await sdk.initialize();
const jobs = new Jobs(sdk);

// Get a job by ID
const job = await jobs.getById(<jobId>);

// Get a job with expanded release (process) details
const job = await jobs.getById(<jobId>, {
  expand: 'Release'
});

// Get a job scoped to a specific folder
const job = await jobs.getById(<jobId>, {
  folderId: <folderId>
});

API Response vs SDK Response

Transform pipeline

pascalToCamelCaseKeys()transformData(data, JobMap)

Field mapping

API Response (PascalCase) SDK Response (camelCase) Change Reason
CreationTime createdTime Case + Rename Consistent SDK time naming
LastModificationTime lastModifiedTime Case + Rename Consistent SDK time naming
OrganizationUnitId folderId Case + Rename SDK uses folderId across all services
OrganizationUnitFullyQualifiedName folderName Case + Rename SDK uses folderName across all services
ReleaseName processName Case + Rename SDK consumer term — "release" = "process"
ReleaseVersionId processVersionId Case + Rename Consistent with processName rename
ProcessType packageType Case + Rename Maps to existing PackageType enum
Release process Case + Rename Consistent with processName rename
All other PascalCase fields camelCase equivalents Case only pascalToCamelCaseKeys() handles automatically

Files

Area Files
Endpoint src/utils/constants/endpoints/orchestrator.ts
Types src/models/orchestrator/jobs.types.ts
Models src/models/orchestrator/jobs.models.ts
Service src/services/orchestrator/jobs/jobs.ts
Unit tests tests/unit/services/orchestrator/jobs.test.ts (4 new tests)
Integration tests tests/integration/shared/orchestrator/jobs.integration.test.ts (2 new tests)
Docs docs/oauth-scopes.md

Refs PLT-100298

🤖 Auto-generated using onboarding skills

ninja-shreyash and others added 6 commits March 26, 2026 14:29
Add getById method to the Jobs service to retrieve a single job by its
numeric ID. Includes optional folderId and OData query support (expand,
select).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
19.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Base automatically changed from sv/onboard-claude-files to main March 26, 2026 12:14
@ninja-shreyash ninja-shreyash requested a review from a team March 26, 2026 12:14
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

Successfully merging this pull request may close these issues.

1 participant