Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
I want Computed Logic for Test case Tracker to populated ASIL & CAL filed values with " Verifies" Filed which linked to 12 requirements trackers
If I select Verifies item, my Test case tracker ASIL / CAL values should automatically generate based on its requirement ASIL / CAL values
Safety Requirement Trackers have ASIL Field (4 Trackers)
Security Requirement Trackers have CAL Filed (4 Trackers)
Now in my Test case if I select Verifies item of any requirement my ASIL values should automatically populated
ASIL Fields in the two Safety Requirements
CAL Field in Physical Security Requirement
CAL Field in Digital Security Requirement
Verifies[0]['ASIL Field']
where ASIL Field is the label of the upstream tracker item fields.
Where a Shared Field is needed, it's a slight change to use the sharedField function instead:
sharedField("CALField", Verifies[0])
where CALField is the Shared Field Name.
Of course if you need to support multiple upstream requirements, you'd use some list-functions such as a Projection and any additionally needed logic, such as summing up all the values for example:
sum(Verifies.{upstream | sharedField("CommonField", upstream)})
An example of the above fields (and an additional common field) setup looks like so:
Test Case with no Verifies:
both ASIL & CAL fields are hidden with the Common Field without a value
Test case with a Safety Requirement upstream:
ASIL Field visible & populated
Test Case with a Security Requirement upstream:
CAL Field visible & populated
If you additionally desire to hide the unused fields, you can of course use another computed expression for the Hide If value:
empty Verifies || contains(Verifies[0].tracker.name, "Security")
and make this as complex or as simple as needed.
Hopefully this is enough to get you started, feel free to reply if there is anything I missed, and good luck!
Hi @JosephM_SAI ,
I have gives the Computed Logics as above , iam able get the Result but including the Option id and other property detials like below : ASIL - QM(C) i dont want the other details
Current logic iam using Subjects >> Verifies
Choice list [4[ >> CAL
Yup that's returning the full option - you can get the `.name` of those, so this should work for you:
subjects[0].ASIL[0].name
and it gracefully evaluates to nothing if the ASIL field for the subject has no chosen value.
If this is a multiple choice list and you want all of their names, that'd involve a projection at minimum:
join(subjects[0].ASIL.{chosen | chosen.name}.toArray(), '
')
to generate
A
B
given an upstream requirements with both A and B options chosen.
Hello @Rubiya,
It looks like you have a response from a community member. If it helped you solve your question please mark the reply as the Accepted Solution.
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.
Thanks,
Vivek N.
Community Moderation Team.