Can I upgrade my iPhone to iOS 8 if it is jailbroken?
You can indeed upgrade a jailbroken iPhone, iPad or iPod Touch (as long as they are compatible) to iOS 8. However, you will lose your jailbreak and all jailbreak apps and tweaks.
There is currently no jailbreak for iOS 8, and once you upgrade to the new iOS, you won't be able to return to an earlier version. So if you like your jailbreak tweaks, don't upgrade to iOS 8. At least not until a jailbreak is available for it, which isn't guaranteed.
If you want iOS 8 regardless, just follow the normal onscreen instructions to upgrade. You don't need to unjailbreak or restore in order to install iOS 8. Be sure to back up on iTunes first.