Creating Custom Templates for Source Code Management
A Code Security account owner can create custom templates for Source Code Management (SCM) platforms that do not appear in the Settings > SCM page. To integrate a platform, create and add templates for these values:
-
Asset URI - Code Security uses this to link to the line of code where the issue appears.
-
Blame URL - Code Security uses this to show which contributors made specific changes to code

Use placeholders to create a template. When Code Security creates a URL to link directly to an issue, it replaces the placeholder with real data about the issue. Enter three curly braces before and after the name of the placeholder.
Supported Placeholders
Data |
Placeholder for Data |
---|---|
URI of you repository |
|
Name of your repository (useful when the SCM has different host for the Git server) |
|
Commit hash associated with the issue |
|
Branch associated with the issue |
|
Line of code where the issue begins |
|
File path where the issue is located |
|
Example Template for Asset URI
{{{assetUri}}}/blob/{{{branch}}}{{{path}}}#L{{{start}}}
Example Template for Blame URL
{{{assetUri}}}/blame/{{{branch}}}{{{path}}}#L{{{start}}}

-
Go to Settings > SCM.
-
At the bottom of the page, use placeholders to create these templates:
-
Asset URI
-
Blame URL
-
-
Click Save.
Warning - When you save the templates, Code Security updates all URLs that it already generated for the SCM platform. If you make templates incorrectly, you may cause unintended changes to data.
-
To test the connection between Code Security and the SCM platform, click the URL.
Known Limitations
-
A custom SCM platform works only for issues that occurred after you created it. To use a custom SCM platform for older issues, remove the relevant assets from Code Security and then re-scan them.
-
It is possible to save templates five times during a five-minute period.
-
After you click Save, it is not possible to save a template while Code Security is creating a new custom SCM platform.