Here's a chart with part numbers and lengths of stock zj rear shafts. Perhaps one will work out for you. Obviously, you may have to look up the lengths of the part numbers shown that don't list the lengths.
That said, however, I searched high and low to find the longest one (30.75") for my own jeep, and found it was actually about 7/8 inch shorter than the listing says. It still worked.
I guess everybody says their shaft is longer than it really is, even mopar.
94 ZJ 5.2 NV3500 242 homebuilt exhaust
83 CJ 258 T5 Dana 300 awaiting 350 swap