0

Update Milestone Progress

by
Published Oct 17, 2025

Update the progress of a milestone in a goal.

Script bamboo_hr Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Update Milestone Progress
4
 * Update the progress of a milestone in a goal.
5
 */
6
export async function main(
7
	auth: RT.BambooHr,
8
	employeeId: string,
9
	goalId: string,
10
	milestoneId: string,
11
	body: Body
12
) {
13
	const url = new URL(
14
		`https://${auth.companyDomain}.bamboohr.com/api/v1/performance/employees/${employeeId}/goals/${goalId}/milestones/${milestoneId}/progress`
15
	)
16

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

32
/* eslint-disable */
33
/**
34
 * This file was automatically generated by json-schema-to-typescript.
35
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
36
 * and run json-schema-to-typescript to regenerate this file.
37
 */
38

39
export interface Body {
40
	/**
41
	 * Whether the milestone is complete or not
42
	 */
43
	complete: boolean
44
	[k: string]: unknown
45
}
46