1- import { BaseResource } from ' ../BaseResource' ;
2- import { Configuration } from ' ../../Configuration' ;
1+ import { BaseResource } from " ../BaseResource" ;
2+ import { Configuration } from " ../../Configuration" ;
33import {
44 UpdateWorkItemPropertyValue ,
55 ListWorkItemPropertyValuesParams ,
66 WorkItemPropertyValues ,
7- } from ' ../../models/WorkItemProperty' ;
7+ } from " ../../models/WorkItemProperty" ;
88
99/**
1010 * WorkItemPropertyValues API resource
@@ -22,7 +22,7 @@ export class Values extends BaseResource {
2222 workspaceSlug : string ,
2323 projectId : string ,
2424 workItemId : string ,
25- propertyId : string ,
25+ propertyId : string
2626 ) : Promise < WorkItemPropertyValues > {
2727 const propertyValues = await this . get < WorkItemPropertyValues > (
2828 `/workspaces/${ workspaceSlug } /projects/${ projectId } /work-items/${ workItemId } /work-item-properties/${ propertyId } /values/`
@@ -45,9 +45,16 @@ export class Values extends BaseResource {
4545 ) ;
4646 }
4747
48-
4948 /**
5049 * Create/update a property value
50+ *
51+ * For single-value properties:
52+ * - Acts as an upsert operation (create or update)
53+ * - Returns a single WorkItemPropertyValues
54+ *
55+ * For multi-value properties (is_multi=True):
56+ * - Replaces all existing values with the new ones (sync operation)
57+ * - Returns a list of values
5158 */
5259 async create (
5360 workspaceSlug : string ,
@@ -61,4 +68,47 @@ export class Values extends BaseResource {
6168 updateData
6269 ) ;
6370 }
71+
72+ /**
73+ * Update an existing property value(s) (partial update)
74+ *
75+ * For single-value properties:
76+ * - Updates the existing value
77+ * - Returns a single WorkItemPropertyValues
78+ *
79+ * For multi-value properties (is_multi=True):
80+ * - Replaces all existing values with the new ones (sync operation)
81+ * - Returns a list of values
82+ *
83+ * @throws {HttpError } If the property value does not exist (404)
84+ */
85+ async update (
86+ workspaceSlug : string ,
87+ projectId : string ,
88+ workItemId : string ,
89+ propertyId : string ,
90+ updateData : UpdateWorkItemPropertyValue
91+ ) : Promise < WorkItemPropertyValues > {
92+ return this . patch < WorkItemPropertyValues > (
93+ `/workspaces/${ workspaceSlug } /projects/${ projectId } /work-items/${ workItemId } /work-item-properties/${ propertyId } /values/` ,
94+ updateData
95+ ) ;
96+ }
97+
98+ /**
99+ * Delete the property value(s) for a work item
100+ *
101+ * For single-value properties:
102+ * - Deletes the single value
103+ *
104+ * For multi-value properties (is_multi=True):
105+ * - Deletes all values for that property
106+ *
107+ * @throws {HttpError } If the property value does not exist (404)
108+ */
109+ async delete ( workspaceSlug : string , projectId : string , workItemId : string , propertyId : string ) : Promise < void > {
110+ return this . httpDelete (
111+ `/workspaces/${ workspaceSlug } /projects/${ projectId } /work-items/${ workItemId } /work-item-properties/${ propertyId } /values/`
112+ ) ;
113+ }
64114}
0 commit comments