Ms Rowling sought damages against Amanda Donaldson in a civil case brought under the author's married name Joanne Murray.
In a written determination issued after the case was heard at Airdrie Sheriff Court, Sheriff Derek O'Carroll found during her employment Ms Donaldson obtained £18,734 through fraud.
He said "having obtained £18,734 from the pursuer by means of her fraudulent misrepresentation" she is bound to repay the sum to her former employer together with interest at 8%.
In a statement, the Harry Potter author said: "JK Rowling is pleased that Sheriff O'Carroll has ruled that her former PA Amanda Donaldson must repay the money she fraudulently misappropriated from Ms Rowling.
"From the outset Ms Rowling made it clear that the decision to take this matter to court was a last resort and not for her personal benefit but rather to protect the reputation of her existing staff and to make sure Ms Donaldson is not in a position to breach the trust of another employer.
"Terms of the recovery will be decided in due course and the money owed will be donated to JK Rowling's charity Lumos."
Ms Rowling alleged Ms Donaldson made transactions including more than £3,000 in retailer Molton Brown, £2,139 in card shop Paper Tiger and more than £1,619 in Starbucks and Costa coffee shops on a company credit card without authorisation.
Ms Donaldson was also accused of fraudulently obtaining £7,742 of foreign currency, more than £1,500 in cash and Harry Potter merchandise worth £3,213.
Mr O'Carroll found Ms Donaldson had use of a business credit card in her name but knew and understood it was not to be used for her personal benefit.
During her employment, she used the business credit card to make unauthorised cash withdrawals for her own use on a number of occasions, amounting to a total of £1,160, and unauthorised purchases for her own use in a large number of retail outlets amounting to a total of £9,832.
She also used her employer's bank accounts to purchase foreign currency worth the Sterling equivalent of £7,742.
The sheriff found there was not enough evidence to prove that Ms Donaldson was responsible for Harry Potter merchandise going missing.
Ms Donaldson worked as Ms Rowling's personal assistant from February 2014 until her dismissal in April 2017.
Mr O'Carroll said the expenditure on Molton Brown toiletries of £3,629 was "extraordinary".
Giving evidence during the case, the author said she did not ask Ms Donaldson to buy the toiletries.
She explained her husband is allergic to strong perfumes so she would never buy them for home or office use.
The sheriff said he found Ms Rowling gave her evidence in a "thoughtful, considered, measured, accurate, honest and reliable fashion" and that where there was in her mind any doubt in favour of the defender (Ms Donaldson), she readily gave her the benefit of that doubt.
Giving final submissions in the case in January Allana Turley, representing Ms Donaldson, said her client never intended to deceive her employer and believed she was authorised to use the card in the way in which she did.
Mr O'Carroll said he did not find Ms Donaldson to be either "credible or reliable".