They did have plans before the film released but they didn't get the green-light until Item 47 came with home media release of The Avengers.
After the Coulson shorts helped video sales, D’Esposito wanted to make longer films — and he got his wish when Winderbaum and writer Eric Pearson (who scripted the first four shorts) pitched a Bonnie and Clyde-esque tale of a couple who use a discarded Chitauri weapon to rob banks and go on the run from S.H.I.E.L.D. “I was reading through a lot of pitches,” D’Esposito says, adding that scrapped ideas include shorts about a young Nick Fury and Maria Hill. “I gravitated toward this one immediately.” Disney CEO Bob Iger did too; after watching Item 47, he greenlit a series about the agents of S.H.I.E.L.D. . - EW.com
But a TV show with Coulson was discussed before the film came:
“We all love Clark Gregg, there’s no doubt about that,” Whedon said. “From before we made ‘The Avengers,’ we discussed whether there was a way for him to be a part of the Marvel Universe, perhaps a part of a TV show even after his death. … The fact of the matter is, as much as we love him, now that I’m really running Marvel, I like to keep a type of artistic integrity, which means we don’t stretch the bounds of reality.”
“There was never going to be a ‘S.H.I.E.L.D.’ show without Agent Phil Coulson!” said Feige - CBR
So they didn't know if show will come or not when they filmed The Avengers but they wanted to have Coulson from the start and that's why they revived him for the show.