Does paracetamol (or ibuprofen) help get rid of UTI or it only helps with the pain?

I'm asking because if it doesn't have any other benefits than pain relief (similar to most cough medicines) I would rather not take it.