Supporting custom conditions in SQL-based custom artifact elements

You can add custom conditions in CAE editor in a new custom artifact element by using SQL as the query language.

About this task

Custom conditions can be added to the custom artifact elements using the SQL by the following steps:

Procedure

  1. In the main menu, go to Views > Create Custom artifact element in the page.
  2. Click Create custom artifact element. As a part of Initial data for custom artifact element
    1. Choose query type, data source, select the scope, choose the artifact element
    2. Click OK.

    Based on the selection, the Engineering Insights application generates the initial SQL query.

  3. In SQL query section on editor page, add the condition as shown in the following format
    $if(workitem_id)$
    AND (rtc_cm_WorkItem1.SHORT_IDENTIFIER = '$workitem_id$')
    $endif$
    query
  4. In the Conditions section of the sidebar, click Refresh refresh.
  5. The Engineering Insights application auto-populates some required fields. You can add the values to the fields that are not defined. For example, set the Label for the custom condition.
    custom label
  6. Click Preview to view the applied custom conditions in action. Here, you need to mention the workitem ID and Run query to view the results.
    preview query
  7. On the results page, click Save to see the changes in created custom artifact element.

    To create a new custom artifact element, see Creating custom artifact elements.