def get_task_no(job_id):
    """Extract the task number from the full job/job step ID"""
    task_info = job_id.split('_')[1]
    task_no = task_info.split('.')[0] if '.batch' in task_info else task_info
    return int(task_no)