When MUST a 1099 -C, -A, etc. be issued?

From researching into this, it would seem that whenever a lender closes out a loan, they are required to file the 1099-C or -A with the IRS as part of the finalizing administrative work. However, I’ve seen signoff letters where it states that this is optional. So, two common scenarios seem to be:

Full foreclosure/auction - required or optional 1099-C/-A?

Short-sale - required or optional 1099-C/-A?

Another one that I’ve run into: defaulted loan submitted to law firm for collection:
Law firm pursues judgment with collections - required or optional 1099-C/-A?

Law firm accepts a payoff - required of optional 1099-C/-A?

This might be a better question for the legal forum, but it applies more prevalent to the Foreclosure forum.

Dean