Skip to main content

Project items

MethodDescription
deleteDelete a project item by SID.
restore_if_deletedRestore a project item only when the API currently reports it deleted.
list_project_itemsList project items.
iter_project_itemsIterate over project items.
get_project_itemGet a project item by SID.
get_project_item_from_linkResolve a traceability link to a rich project item.

delete​

delete(sid: str) -> None

Delete a project item by SID.

Parameters:

NameTypeDescriptionDefault
sidstrThe SID of the project item to delete.

restore_if_deleted​

restore_if_deleted(sid: str) -> ProjectItem

Restore a project item only when the API currently reports it deleted.

This method re-checks deletion status from the API instead of relying on local caller state. If the item is not deleted, it emits a warning and returns the current typed project item without sending a restore request.

list_project_items​

list_project_items(
*,
name: str | None = None,
folder: Folder | str | None = None,
limit: int | None = None,
deleted: bool = False,
after: str | None = None
) -> Page[ProjectItem]

List project items.

Parameters:

NameTypeDescriptionDefault
namestr | NoneOptional name filter.None
folderFolder | str | NoneOptional folder filter.None
limitint | NoneMaximum number of results to return.None
deletedboolWhether to include deleted project items.False
afterstr | NonePagination cursor.None

Returns:

iter_project_items​

iter_project_items(
*,
name: str | None = None,
folder: Folder | str | None = None,
deleted: bool = False
) -> Iterator[ProjectItem]

Iterate over project items.

Parameters:

NameTypeDescriptionDefault
namestr | NoneOptional name filter.None
folderFolder | str | NoneOptional folder filter.None
deletedboolWhether to include deleted project items.False

Yields:

get_project_item​

get_project_item(
sid: str, *, revision: int | None = None, allow_deleted: bool = False
) -> ProjectItem

Get a project item by SID.

Parameters:

NameTypeDescriptionDefault
sidstrThe SID of the project item.
revisionint | NoneOptional revision number.None
allow_deletedboolWhether to allow retrieving deleted project items.False

Returns:

get_project_item_from_link(
link: str, *, allow_deleted: bool = False
) -> ProjectItem

Resolve a traceability link to a rich project item.

Parses link to extract the first SID found, then fetches the corresponding project item. The method is intentionally lenient: it accepts full app URLs, bare /{sid} paths, API paths, and plain SIDs.

Two distinct warnings are emitted when relevant:

  • Origin mismatch – the scheme+host of link does not match the client's configured app_url. The SID is still extracted and the fetch proceeds.
  • Extra query parameters – the URL contains query parameters beyond the known navigation-only params (cm_activeComponent, sc_activeComponent, revision). Those params are silently stripped; the warning lists which ones were dropped.

Parameters:

NameTypeDescriptionDefault
linkstrA URL or string containing a Jinko SID. May include query parameters, fragments, and any scheme/host.
allow_deletedboolWhether to allow retrieving deleted project items.False

Returns:

Raises:

  • ValueError: If no SID can be found in link.