WASHINGTON — A former Fox News journalist disclosed on Thursday that he had been subpoenaed in 2011 for notes and testimony identifying his confidential sources in a leak investigation, adding a new public chapter to the Obama administration’s crackdown on unauthorized disclosures.

Later, in a surprise move, the House of Representatives voted 225 to 183 to approve an amendment to an appropriations bill barring the Justice Department from compelling reporters to testify about confidential sources. Advocates for journalists have tried for years to enact a federal “media shield” bill allowing judges to quash such subpoenas.

The legislation, sponsored by Representative Alan Grayson, Democrat of Florida, has a long way to go before it would become law; in 2009, the House approved a media shield bill, but it died in the Senate. But the latest measure, approved just after midnight on Friday, resonated with the disclosure by the former Fox News reporter and producer, Mike Levine, who now works for ABC News.

Mr. Levine wrote in an article on the ABC News website that he was subpoenaed in January 2011, when he worked for Fox. He fought it rather than comply, he said, and the Justice Department dropped it in April 2012.