The Connector SDK APIs are available through Forge's Early Access Program (EAP).
EAPs are offered to selected users for testing and feedback purposes. We are currently working with a select group of EAP participants to get their apps production-ready and available for publishing on Marketplace.
To use the Connector SDK, you must be part of the Forge connector EAP. If you are interested in joining this EAP, you can express interest through this form.
The deleteObjectsByProperties
method allows you to delete entities from the Teamwork Graph based
on specific property criteria. This is useful for removing entities that match certain conditions
rather than knowing their exact external IDs.
1 2deleteObjectsByProperties(request: DeleteObjectsByPropertiesRequest): Promise<DeleteObjectsByPropertiesResponse>
DeleteObjectsByPropertiesRequest
1 2// DeleteObjectsByPropertiesRequest object: { properties: Record<string, string>; objectType: string; connectionId?: string; // Optional: Connection identifier for multi-connection scenarios }
1 2import { graph } from '@forge/teamwork-graph'; const request = { properties: { environment: 'staging' }, objectType: 'atlassian:document', connectionId: 'connection-id-123' }; const response = await graph.deleteObjectsByProperties(request); if (response.success) { console.log('Deletion completed successfully'); } else { console.error('Error deleting entities:', response.error); }
For EAP, deleteObjectsByProperties supports only 1 key-value pair as shown in the above example.
1 2const request = { properties: { environment: 'staging' }, objectType: 'atlassian:document', connectionId: 'connection-id-123' }; const response = await graph.deleteObjectsByProperties(request); if (response.success) { console.log('All matching entities deleted successfully'); } else { console.error('Deletion failed:', response.error); if (response.originalError) { console.error('Original error:', response.originalError); } }
Only one property
per request.
The method validates the following:
property
object must only contain one property criteria for deletion.Error message | Description |
---|---|
properties must be an object | The request is not an object. |
properties object cannot be empty | The properties object is empty. |
Property-based deletion failed | The overall operation failed. |
The method returns a promise that resolves to a DeleteObjectsByPropertiesResponse
object.
1 2// DeleteObjectsByPropertiesResponse { success: boolean; // Indicates if the overall operation was successful error?: string; // Overall error message (if operation failed) originalError?: unknown; // Original error object (if available) }
The SDK provides type-safe responses that ensure compile-time validation:
1 2import { types } from '@forge/teamwork-graph'; // Type-safe request creation const request: types.DeleteObjectsByPropertiesRequest = { properties: { environment: 'staging' }, objectType: 'atlassian:document', connectionId: 'connection-id-123' }; const response = await graph.deleteObjectsByProperties(request); if (response.success) { // TypeScript knows success is true here console.log('All matching entities deleted successfully'); } else { // TypeScript knows error exists here console.error('Deletion failed:', response.error); // Safely access originalError if available if (response.originalError) { console.error('Original error details:', response.originalError); } }
The type system ensures:
request
must be a valid object with string key-value pairsresponse.success
is always a booleanresponse.error
and response.originalError
are properly typed when presentRate this page: