Convert Project-scoped ignores to asset-scoped ignores
Conversion setup
Conversion provides you with control over which ignores Snyk converts. For example, if you monitor multiple branches for a given repository, you can decide what ignore metadata Snyk converts and uses as the single source of truth going forward.
The following scenario assumes that you have ignored issues within your Snyk Code Project prior to enabling Snyk Code Consistent Ignores.
If you have enabled the Snyk Code Consistent Ignores feature and have not performed a rescan since, in order for the Ignore across repository button to be active, it is possible that you need to retest the Project. In most cases, the Ignore across repository button is active, and this step is not necessary.
Convert individual ignore
In the Snyk Web UI, navigate to a Project and open an issue card that contains an issue that was ignored before enabling this feature.

A warning states that the ignore was created through the legacy system and is not consistent across the repository. All issues ignored before enabling the feature appear with this warning, so you can determine what ignore metadata must be converted and used as the source of truth.
To convert an issue from a Project-scoped to an asset-scoped ignore, click Ignore across repository.
How Snyk handles metadata
Consider the following implications for conversion:
Ignored by and Timestamp reflect the time and user who performed the conversion, not the original ignore creator or the date of the ignore.
Reason, Description, and Expiration date are all retained.
Bulk ignore conversion
Bulk conversion from the Snyk Web UI
You can migrate pre-existing Project-scoped ignores to asset-scoped ignores manually on the Projects page.
To convert all legacy ignores from a Project page, navigate to your Organization > Projects, and then click Convert (number of) ignores in this Project.
Convert ignores using Snyk API
For Snyk Code Projects with over 200 legacy Project-scoped ignores, or in scenarios where you want more control over the values applied for ignore attributes, consider using the Snyk API instead. This allows you to programmatically convert Project-scoped ignores to asset-scoped ignores.
The following sequence of API calls allows you to build a custom script tailored to your Organization's needs for this conversion. It does not provide a prescriptive approach, but provides information on the most likely endpoints to consider.
Steps to follow:
List relevant Snyk Code Projects
Goal: Identify the project_id for the Snyk Code Projects whose ignores you want to convert.
API Endpoint:
GET /rest/orgs/{org_id}/projects
Filter: Use the query parameter
&types=sast
to list only Snyk Code Projects.
Retrieve existing Project-scoped ignores for a Project
Goal: For a specific Project identified in step 1, get the details of all its current project-scoped ignores.
API Endpoint:
GET /v1/org/{org_id}/project/{project_id}/ignores
Response format: The response is an object where each key is a project-scoped finding ID (
snyk/org/project/finding/v1
) that has an ignore applied. The value is an array containing details about the ignore(s) for that finding.
Map Project-scoped findings to asset-scoped findings
Goal: Find the corresponding asset-scoped finding ID (
snyk/asset/finding/v1
) for each Project-scoped finding ID identified in step 2.API Endpoint:
GET /rest/orgs/{org_id}/issues
Filters:
Use
&scan_item.type=project&scan_item.id={project_id}
to filter issues for the specific project.Optionally, use
&status=open
if you only need to map open findings. Note that it is possible that ignores findings can also exist for resolved findings.
Response format: The response contains a list of issues within the Project.
Create the new asset-scoped ignore policy
Goal: Create a new policy that replicates the original ignore but targets the asset-scoped finding ID obtained in step 3.
API Endpoint:
POST /rest/orgs/{org_id}/policies
Payload: Construct the payload using the information gathered. Map the
reasonType
from step 2 to theignore_type
field, use the reason from step 2, and use the asset-scoped ID (key_asset
) from step 3 as the value in the condition.
Delete the original Project-scoped ignore
Goal: Remove the legacy Project-scoped ignore now that an equivalent asset-scoped policy exists.
API Endpoint:
DELETE /v1/org/{org_id}/project/{project_id}/ignore/{project_scoped_id}
Key Information: Use the project_id from step 1 and the
{project_scoped_id}
which is the key from step 2 response (e.g.,1ddad474-39f1-4ac4-b9c6-f2f79a65fd88
).
Verify the changes
Goal: Ensure the conversion was successful and the finding remains ignored under the new policy.
Action: Retest the relevant Project in Snyk (
snyk code test
or using the Snyk Web UI).Check: Confirm that the finding previously covered by the Project-scoped ignore is still ignored.
Last updated
Was this helpful?