Added logic to fix data lookup issue.

refs #4890

The simple logic to look up a link primary key ID from a task
config didn't work in all instances.