Use the TaskRay ID Resolver Apex Method in Your Own Code