That’s mean that they have to urinate or take care of other unpleasant business or perhaps both. It’s an infantile expression of utilizing the bathroom.
When people use the expression "I've got to take a potty trip."