Is there a way in Jira to track how long a item was flagged for( the work couldnt continue as it was blocked ) ? I am able to quickly see all the blocked items by using Flagged = Impediment but I need a way to see how long the item was blocked for to report on.
This doesn't directly answer your question but it's important nevertheless.
Flagging an issue is only meant to give an issue maximum priority, not blocking an issue, according to JIRA: https://confluence.atlassian.com/jirasoftwareserver071/flagging-an-issue-800706915.html
It's a bit strange since the way you look for a flagged issue with JQL is
Flagged = Impediment
One option you have is using a mix of blocked status & last update of the issue. This approach has a caveat, as I will also explain.
The JQL search would be:
project = "MY PROJECT" AND status = Blocked ORDER BY updated ASC
The "Updated" field should be visible in your filter, so you can see that info.
One potential problem with the solution is that any update to the issue would obviously update the issue, e.g. a comment on the issue, a change in the description, etc.
If you wanted a solution that was totally reliable, then I would go for the ScriptRunner plugin. I could write a custom field that would show time from last issue transition, if you have the plugin and are interested.