This is very important. You have to make sure you have the upper hand. This has been successful for me even in the private sector. I left a department once with another offer in hand, and they were willing to rewrite the job spec (and salary range) to convince me to stay. The other offer was more lucrative with more upward mobility, so I ended up leaving anyway, but it's a much better experience when you don't have anything to lose.