So I have to find all solutions of $e^z=i$. Instead of the usual method (write $z = x+yi$ and compare real and imaginary parts), I wrote $e^z = e^{iz/i}$, and therefore
$$\cos\left(\frac{z}{i}\right) + i\sin\left(\frac{z}{i}\right) = \cos\left(2k\pi+\frac{\pi}{2}\right) + i\sin\left(2k\pi+\frac{\pi}{2}\right),$$
which gave me the correct solution $z = \left(2k\pi+\frac{\pi}{2}\right)i$. Is there something illegal with this? My main concern are the factors $\cos\left(\frac{z}{i}\right)$ and $\sin\left(\frac{z}{i}\right)$, given that their argument $\frac{z}{i}$ is now potentially a true complex number, which could mess up the value of $\sin$ and $\cos$. Thanks!
Your approach is correct. But I would suggest to write instead $$i=0+i\cdot 1=\cos(\pi/2+2k\pi)+i\sin(\pi/2+2k\pi)=e^{i(\pi/2+2k\pi)}$$