Hello,
It is not necessary to inform the department if you are appearing before the court as a witness, in case had you been appearing as accused then it would have been necessary.
Also there is no problem if you inform the department about the same. Although the head of personal and family matter will cover your also.
Regards