Script creation and command line execution example
Overview
Scripts created with the script editor can be executed from the command line.
This page uses the example of "A function that filters issues with severity "high" in the created script" to introduce the process from creating a script to executing it with a batch file.
Please refer to the video below to see how it actually works.

This is done in two steps.
Step 1. Create a script file
As an example, we will create a script in the script editor to filter and display only those with a severity of "high" from the multiple registered issues.
The general flow is as follows.
- Get a list of issues related to the review file
- Get issue information with a severity of "high"
- Filter by the acquired issues
Specific operations
First, get the active review window and enable Lightning Review operations.
As shown below, method candidates are displayed, so you can get some information without referring to the API reference.

Next, get a list of issues to filter.
You can get a list of issues with "review.GetAllIssues()", so set the conditions as follows.
-
To filter by "Importance: High" in this example:
The input suggestion "Importance" will display an explanation of the severity, so specify "High" in issue.Importance. -
As another example, to filter by "Priority: High":
Use issue.Priority.
Below is a sample of the code created.
//Get the reviews for the active window
var review = App.ActiveReviewWindow.Review;
//Set the IDs of high-severity issues as a comma-separated string
var issueIds = string.Empty;
foreach(var issue in review.GetAllIssues())
{
if (issue.Importance == "High")
{
issueIds += "," + issue.Id;
}
}
//Apply the filter
App.ActiveReviewWindow.ApplyIdFilter(issueIds);
Save the script file you created.
Step2. Run with a batch file
Since the script can be run from the command line, enter the contents you would like to enter on the command line and run the batch file.
set exePath="C:\Program Files (x86)\Denso Create\Lightning Review\LightningReview.exe"
%exePath% --run "C:\work\Scripts\Filter high severity issues.csx"
The execution result is the video described in "Overview".