York Evening Press crime reporter Chris Greenwood interviewed the victim of an horrific samurai sword attack, and seven months later was called to give evidence in the subsequent trial.
A summons was issued ordering him to present his shorthand notes and all other relevant material to the city's Crown Court.
The newspaper was only made aware that defence lawyers had demanded the information by an alert court reporter who heard the discussions.
The lawyers wanted more information about how some details of the exclusive front page story differed from the victim's police statement.
Chris had used local contacts to get access to the badly-injured man immediately on his release from hospital, several days before detectives interviewed him.
In a letter to the court, the newspaper resisted the court order, arguing that handing over the notes could jeopardise the reporter's credibility and his ability to protect sources and contacts.
But the judge decided that the notes were of substantial value as evidence and that there was an over-riding public interest in disclosure.
Chris, (28), who joined the Evening Press as a trainee in January 2001 and has recently been promoted to assistant news editor, said the court appearance was "extremely nerve-wracking".
He said: "All those hours of shorthand practice have paid off. This was an early morning interview that I turned around in less than fifteen minutes for our first edition.
"I had no idea that seven months later I would be digging my notepad back out and giving evidence to a jury about exactly what was said between us.
"I've certainly seen the courtroom from a different perspective now I have been in the witness box. It's a great reminder that your notes need to be clear and easy to find."
Editor Kevin Booth said: "We objected to this particular order because the confidentiality of a reporter's notes is not something that should be sacrificed lightly.
"The judge decided to proceed 'in the public interest'. No sources were to be compromised, so we reluctantly acceded to the order.
"However, we remain concerned to preserve the principle of confidentiality, and we reserve our right strenuously to resist any order requiring journalists to reveal their sources."
John O'Callaghan, (39), and Stephen Hammond, (49), of Hertfordshire, were jailed for eight and seven years respectively after a jury found them guilty of the attack on Monday.