Expand my Community achievements bar.

"Escaping out" a comma from the name of a parameter when doing a search

Avatar

Level 5

This is a new one.

 

I'm working on an automation which determines all common paramterValues between an issue an a document. When it has its list, it plops the list into the output field of a search module and pulls those exact fields. 

 

Everything works...until a parameter has a comma in the name of it. 

 

If I do things the "normal" way and specifically select the name of the field, the system works correctly:

JohnJOSullivan_0-1738255194258.png

JohnJOSullivan_1-1738255213099.png

However, if I attempt to do this by entering the name of the field, Fusion gets confused. It thinks it's two fields instead of one and then Fusion errors out.

JohnJOSullivan_2-1738255312595.png

JohnJOSullivan_3-1738255343459.png

JohnJOSullivan_4-1738255371791.png

 

I know I have to "escape out" the comma using the text parser to make Fusion realize that it's actually on field instead of two. I'm trying to look at the output bundles but I'm not seeing something which stands out.

 

Any ideas?

 

1 Reply

Avatar

Level 5

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.  

 

JohnJOSullivan_0-1738707930748.png