57. Copy Triage context
It is often useful to obtain the context of a Triage tree cluster or a selection of runs, and use the context outside of Foretify Manager.
Some typical use cases are:
-
Performing additional analysis on the runs of a cluster using external tools, such as another programming environment (Python, MATLAB, Jupyter notebooks, etc.)
-
Running a 3rd party debugger on runs
-
Extracting and processing logs for a selection of runs
To copy a Triage cluster context to the clipboard:
-
In the main Triage view, hover over a cluster in the tree, click the three dots (...) that appear, and select Copy Category Path to Clipboard.
The context of your selection is copied to the clipboard as an encoded string.
To copy a Triage run selection to the clipboard:
-
Select one or more runs in the Runs table and click the Copy To Clipboard icon on the top right.
The context of your selection is copied to the clipboard as an encoded string.
To use the content in a 3rd party application:
-
Obtain the encoded context by doing either of the following:
-
Copy the context to the clipboard as described above, then paste the context into a text editor.
-
Programmatically extract, for example, using Python's clipboard access API:
pyperclip.paste().
-
-
Use Foretify Manager's Python SDK to retrieve the runs associated with this category, by calling:
get_runs_in_triage_by_encoded_context(encoded_context)This API gets the copied encoded context and returns a dataframe with all the runs in the cluster, defined by the context.
A paged version is also available:
page_runs_in_triage_by_encoded_context(encoded_context, pagination={"page": 0, "size": 50}, orderBy=None, detailed=False)- Gets the encoded context plus pagination details and returns the relevant page.
These APIs return the list of runs that match the context, which can then be processed by the 3rd party application.
The application can also decode the context, if further manipulation of the context is required before accessing the Foretify Manager server. To do so, call the following:
get_triage_context_as_dict(encoded_context)- Gets the encoded context and transforms it to a Python dictionary representation.