There is nothing wrong with relieving oneself (urinating or defecating) during the athaan (call to prayer), but the person who is relieving himself cannot repeat the athaan. He should wait until he has finished relieving himself and then repeat the words of the azan.
An-Nawawi
“It is disliked for a person who is sitting to relieve himself to mention Allaah with any kind of thikr (remembrance of Allaah); so he does not say, ‘Subhaan Allaah’ or ‘Laa Ilaaha illa Allaah’, nor does he answer the greeting of Salaam or say
‘Yarhamuka Allaah’ (may Allaah have mercy upon you) to a person who has sneezed, and he should not say ‘Alhamdu Lillaah’ if he sneezes, nor does he repeat the words that the mu’aththin says.
The scholars also said that one does not say any such thikr when having sexual intercourse with his wife. If he sneezes in these cases, then he should praise Allaah (say ‘Alhamdu Lillaah’)
in himself without moving his tongue. What we mentioned regarding the dislike of saying thikr when urinating and having sexual intercourse is the dislike that does not amount to prohibition, so there is no sin if someone does it.”
As regards doing work, such as writing and the like, when the athaan is being called, then there is nothing wrong with that either. However, if this work prevents one from repeating the words of the athaan,
then it is more appropriate to stop and repeat the words of the athaan and then one may continue his work afterwards unless there is harm in stopping, as this would constitute following the Sunnah and seeking the reward that one gets when repeating the words of the athaan.