Dropdown categories for Risksheet

Modified on Wed, 23 Jul at 12:35 PM

In some cases, it can be helpful to filter suggested work items in your Risksheet based on user input—such as selecting a specific category from a dropdown menu.




TABLE OF CONTENTS


Configuration

1. As a prerequisite, we should have the enumeration with needed categories created in the Polarion Administration

2. After that, we can add our enumeration dropdown to the risksheetTopPanel.vm file (check this article if you are not familiar with it)

Cars:
<select name="cars" id="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>

3. In the end, we will see the Enum on the top panel


4. Create a query that will help the system understand that we would like to see only items that have the same category as the one we've selected on the top panel

...
"queryFactories":{
      "hazardQuery":"function(info){return ''+$('#cars').val();}"
    },
..


5. Add the "queryFactory" to the column with the itemLink you have to filter (hazard in this case)

..
 "id": "hazard",
 "bindings": "hazard.title",
      "typeProperties": {
        "linkRole": "assessedHazard",
        "linkTypes": "hazard",
              "queryFactory": "hazardQuery"
      }
   ..


6. The Risksheet will show you only items that correspond to the selected option.




For any assistance, please don’t hesitate to reach out by submitting a ticket here.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article