Is it possible to get the task session ID from a task inside of a Policy Xpress policy? Are there other unique identifiers I could use from within a Policy Xpress policy? I'd like to send out an email when certain tasks fail, but I'd like to include a unique identifier of some sort so that we can find the failed task immediately in the VST.
Unfortunately, the task ID is not one of the exposed attributes in the API. It can be retrieved via BLTH using the getTaskUniqueName() method, but methods are not available via PX.
BLTHContext.getSessionId() output can be set in a logical attribute or session variable and PX can read the value of logical attr/session var thereafter.
I would like to add in addition to what Sumeet suggested. If you are using IM 12.6 SP5 or higher, "Task Number" is available in PX. Task Number is a user-friendly number directly linked to Task Session ID. You can search tasks in View Submitted Tasks using this user-friendly "Task Number"