Alternately,
var="$(tesmcmd jobmon +i -a 41844 | sed -n "/run_id/s/[^0-9]//gp")"
tesmcmd jobrelease $var
Some explanation:
var="$( ... )" captures the output to a variable,
-n tells sed to not output anything unless the p flag is given,
/run_id/ selects only the line that has that text,
s/...// is the substitution syntax, though we are substituting nothing thus deleting,
[^0-9] matches any non-numeric character,
g makes the substitution global on matching lines,
p means print the results.