Getting RTC Enumeration External Value through js Calculated Value script
Hello,
Accepted answer
What is an external value for an enumeration? For a specific enumeration value in an attribute, you can access
Comments
Hello Ralph,
Not from what https://jazz.net/wiki/bin/view/Main/AttributeCustomization explains.
Ok, Thanks Ralph, I will work with the labels
The getValue() returns the ID and the ID
- Is language independent
- does never change
One other answer
I have a script that uses REST to get enumeration values of a work item other than the current work item (the one in view as the script is running). In RTC 5.x, this returned resource URLs to enumeration literals which were structured like this:
{base url}/ccm/oslc/enumerations/{project area OID}/{[enumerationList$]enumeration ID}/{external value if available, otherwise ID}
So I used to just parse the last segment of the resource URL so that I could get external values without turning around another REST call.
In 6.x, there was an error in my script that I found out was caused by the fact that RTC 6.x always returns resource URLs to enumeration literals structured like this:
{base url}/ccm/oslc/enumerations/{project area OID}/{[enumerationList$]enumeration ID}/{enumeration ID, even if an external value is available}
I got to this question right away upon searching for information about this change. If I get the time, I'll look into the release notes for RTC 6. I'll just write a method to turn around and call the resource URL for the complete literal's object in JSON and parse that for the actual label or external value.
Thought I'd share that in case it applies to Sany's question, or to others who search for similar needs.