To me the question is equivalent to what is the function of consciousness itself.
Let me elaborate. There is a difference between affects/emotional circuits and feelings. The level at which for eg. Jaak Panksepp works is emotional circuits or affects that are primarily unconscious and can be conceived of in terms of instincts.
If fear circuit is activated, the organism exhibits a flight-fight-freeze response. Conscious feeling of fear may or may not be involved, but physiological changes like activation of sympathetic system happens. If the unconscious fear circuit is OK to keep us out of harm's way (predators) why do we also need to feel fearful? A related meta question is, if a zombie behaving like me, but having no qualia, can and will succeed similar to me, why have consciousness?
I'll address the questions, but first let me solidify the claim that unconscious processes are sufficient for most adaptive regulations. Consider your example of heat/cold as thermo-regulation of body temperature...but do you really need to 'feel' heat/cold for that. Consider when you are sound asleep- you still unconsciously cover with blanket or throw away blanket depending on how sweaty/ cold you are- you dont need to consciously register that. So thermo-regulation, like other adaptive actions of affects, can happen in absence of accompanying felt feelings.
So what is the purpose of consciousness/feelings? They provide flexibility to behavior and leave it to us whether we want to indulge in adaptive hardwired behavior or do differently. Taking our cold/heat analogy, instead of wiring our thermo-regulation behavior entirely, feelings provide us a way to keep remaining cold, despite feeling cold.
Similarly, consciousness/'free wont' gives the ability to suppress prepotent (adaptive in short term) response in favor of our long term view or values. By way of another example, if all we had was an unconscious fear circuit, we would always run when confronted with large challenges that are insurmountable; but when the conscious feeling of fear comes into play, although we may feel sacred as hell when confronted with larger opponents, we can still act bravely and with integrity- and that may be far adaptive in the longer run.
So the short answer is that conscious feelings like jealousy etc. exist so that we can act contra to that feeling if we wished to do so and are not doomed to always act as per what the feeling dictates!