Step 1: Use the tangent subtraction identity.
We know that
\[
\frac{1-\tan\theta}{1+\tan\theta} = \tan\left(\frac{\pi}{4}-\theta\right)
\]
Step 2: Rewrite the given equation.
\[
\tan\left(\frac{\pi}{4}-\theta\right) = \frac{1}{\sqrt{3}}
\]
Step 3: Use the standard value of inverse tangent.
\[
\frac{\pi}{4}-\theta = \frac{\pi}{6}
\]
Step 4: Solve for \( \theta \).
\[
\theta = \frac{\pi}{4}-\frac{\pi}{6} = \frac{\pi}{12}
\]
Step 5: Conclusion.
Since \( \theta \in \left(0,\frac{\pi}{2}\right) \), the required value is
\[
\theta = \frac{\pi}{12}
\]