0

Update Goal Progress

by
Published Oct 17, 2025

Update the progress percentage of an individual goal.

Script bamboo_hr Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Update Goal Progress
4
 * Update the progress percentage of an individual goal.
5
 */
6
export async function main(auth: RT.BambooHr, employeeId: string, goalId: string, body: Body) {
7
	const url = new URL(
8
		`https://${auth.companyDomain}.bamboohr.com/api/v1/performance/employees/${employeeId}/goals/${goalId}/progress`
9
	)
10

11
	const response = await fetch(url, {
12
		method: 'PUT',
13
		headers: {
14
			'Content-Type': 'application/json',
15
			Authorization: 'Basic ' + btoa(`${auth.apiKey}:x`)
16
		},
17
		body: JSON.stringify(body)
18
	})
19
	if (!response.ok) {
20
		const text = await response.text()
21
		throw new Error(`${response.status} ${text}`)
22
	}
23
	return await response.json()
24
}
25

26
/* eslint-disable */
27
/**
28
 * This file was automatically generated by json-schema-to-typescript.
29
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
30
 * and run json-schema-to-typescript to regenerate this file.
31
 */
32

33
export interface Body {
34
	/**
35
	 * The percentage of completion for the goal (0-100)
36
	 */
37
	percentComplete: number
38
	/**
39
	 * The date when the goal was completed in YYYY-MM-DD format. Required when percentComplete is 100.
40
	 */
41
	completionDate?: string | null
42
	[k: string]: unknown
43
}
44