Creates a pull request for a Salesforce DevOps work item via the Salesforce Connect REST API.
// Source: https://github.com/salesforcecli/mcp | License: Apache-2.0 | Copyright 2025 Salesforce, Inc
// Provided via justclaw.it.com; keep this notice with the code.
import { type Connection } from '@salesforce/core';
const API_VERSION = 'v65.0';
/**
* Creates a pull request for a work item using the provided Connection.
* API: POST /services/data/v65.0/connect/devops/workItems/<workItemId>/review
*/
export async function createPullRequest(connection: Connection, workItemId: string): Promise<any> {
if (!workItemId) {
throw new Error('Work item ID is required to create pull request.');
}
const path = `/services/data/${API_VERSION}/connect/devops/workItems/${workItemId}/review`;
try {
const response = await connection.request({
method: 'POST',
url: path,
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key