how to get content from ID of artifact (IDENTIFIER)
One answer
I'm wondering what's the use case. If you're using JavaScript, most likely you are using the RM Extension API.
https://jazz.net/wiki/bin/view/Main/RMExtensionsAPI605#AttributeValues
You should be able to get the primary text via the RM.AttributeValues class.
What gets me confused is that, you should be on the RM Web UI already, then why do you need to use API if you only want to see the primary text?