I think i found the problem.
The problem was with the first class where i was using Team project = @Project
and @Project was set to one iteration path and hence it was always showing the result from one iteration path.
Removing the first class solved the problem.