Welcome to the Jazz Community Forum
error on tags attribute customization

I am trying to create an attribute customization on the tags field, in order to add additional tags.
the tag field seem to accept only a collection type, but when I read the value it returns a common string (values separated by comma)
the following code simply reads the value of the Tags attribute and try to set the same value, the other example I tried are commented - I tried to return an array and a javascript object/ collection. none of the options worked, I always get the following error:
Error: java.lang.String incompatible with java.util.Collection | Details: java.lang.String incompatible with java.util.Collection
(this error appears even when I return an object or array)
I would like to know what is the valid format that this attribute expects to receive, there is no place in the documentation talking about this format.
I removed the source code because the question was being flagged as spam!!!
2 answers

I was easily able to reproduce the behavior you describe. The {{ }} syntax didn't seem to work. I am afraid I can't find a solution to this using Javascript. I think you could do this without too much problem using a Java based attribute customization, where it is easy to control what type is returned. Let me know if you are interested to know more about how to do that. You can find some useful tips in the bottom of the wiki page and in pages created by Ralph Schoon:
https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Providing_new_customizations_imp
https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/

I will post here Ian's Wark comment so it can be considered the final answer:
"I was easily able to reproduce the behavior you describe. The {{ }} syntax didn't seem to work. I am afraid I can't find a solution to this using Javascript. I think you could do this without too much problem using a Java based attribute customization, where it is easy to control what type is returned. Let me know if you are interested to know more about how to do that. You can find some useful tips in the bottom of the wiki page and in pages created by Ralph Schoon:
https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Providing_new_customizations_imp
https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/
"
Javascript customization have its limitations, which include handling complex type attributes - so it is not possible to assign new tags using javascript customization
Comments
Leonardo Schuler
May 02 '18, 4:35 p.m.Ian Wark
May 03 '18, 4:32 a.m.I know this isn't guaranteed to work.
https://jazz.net/forum/questions/102338/how-to-do-attribute-customization-to-clear-description-field
I'll test this out and see if I can figure out. Have you tried return {{val1|val2}}; type syntax? This can be used to return values in HTML type fields.
I don't think this is critical, but I recommend obtaining the value of the Tags attribute using the built-in WorkItemAttributes.TAGS.