Convertion from TCP pose to Joint Positions

Hi,

I’m coding an app with UR script but I’m stuck with the convertion mentioned in the title.

Is there any formula or function for this?

Many thanks in advance.

try get_inverse_kin().