Update: So I stopped trying to figure out to escape out a stinking comma and ended up re-writing the whole thing.
Just like before, I had Fusion gather all the parameter names from the document. I needed those to use as a filter so Fusion would only grab information from the issue/project which can be placed on the document.
Then, I did a custom API call to gather all parameterValues from the issue/project. I transformed it into JSON so I could be able to separate each parameterName/Value pair into its own line (e.g. "nameOfParameter":"parameterValue"). I did some text parsing to do this, then did a split() on the JSON. I added all of these lines into its own array.
Then, I iterated out the document parameter names. For each name, I iterated out all the parameterName/Value pairs to see which parameters also appear on the document. Anything that passed the filter got added to a new array.
Finally, I added some additional custom forms to the document, took the array, reconverted it into JSON, then did a custom API PUT command to add all of those parameterValues to the document.
So hurray--only the fields which exist on the document get transferred from the issue/project. And it works very well.
And all of this because of a stupid comma.
