i suspect the issue is that the job data doesn't appear in the so_job_history table until after the job is complete, and this would include after conditions
try using the so_job_queue table instead:
select so_ref1 from so_job_queue where so_jobid={jobid}
let us know how you get on