How to show created requirements attributes in the requirements content?

Hello, I want to show the attributes that a requirement has in the text. I have the requirement’s attributes imported correctly but I can’t find the aql expression that call those attributes. Let’s say I have an attribute called ‘Number of hours’ and I want to show it in the text, this would be my expression for it:

If someone know how to solve this please let me know, Thank you!!

Hi,
I try somethink with my Requirements Preference (forget the end of the script which is for showing the reqIfName). It seems to work but I have only One StringValueAttribute. I am not sure that it works if you have several StringValueDefinition. It looks like that:

dvd

Hi David, it worked for one of the attributes that was a string, I think it might not work on all because the others are enumerations, but this allowed me to work around.
Thank you for the help!!

You could try somethink like that:
self.ownedAttributes->filter(Requirements::EnumerationValueAttribute).values.ReqIFLongName

dvd

This didn’t work for me.
In the Requirements Viewpoint menu "Configure Requirement’s Labels in Diagrams’ I put your expression in the Requirement’s label ‘expression’ field (prefaced with “aql:”):

aql:self.ownedAttributes->filter(Requirements::EnumerationValueAttribute).values.ReqIFLongName

My requirements all have a ‘Long name’. However when I refresh the diagram with the requirements, and the label remains blank.

Anyone have any ideas for making Requirement labels work?

That should do the trick (your expression was only getting requirements of types enum):
aql:self.ownedAttributes->collect(a | let v = if a.oclIsKindOf(Requirements::EnumerationValueAttribute) then a.values.ReqIFLongName else a.value.toString() endif in '- ’ + v)