Supporting project scope in SQL based custom artifact elements

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

About this task

You can add project scope in conditions to the Custom Artifact elements by using SQL as the query language with 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. On the editor page, in the SQL query section, add the condition as shown in the following format
    $if(multipleProjectAreas)$ 
    AND (rtc_cm_WorkItem1.PROJECT_AREA_ID IN ($multipleProjectAreas$))
    $endif$
    project scope sql
    Note: When using the SQL based CAE in View and to apply View level project scope, you need to set the variable name as multipleProjectAreas.
  4. In the Conditions section of the sidebar, click Refreshrefresh.
  5. The Engineering Insights application auto-populates some fields. You can add the values to the fields that are not defined. For example, set the Type field as Project Area from the drop down.project scope
  6. Click Preview on the results page to view the project scope in action.
    preview projectscope
  7. Click the edit Pencil icon to open the Select project area dialog box. Select the required project areas.
  8. Click Run query to see the results that scoped down to the selected project areas.
  9. Click Save to see the changes created in custom artifact element.

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