LogoLogo
  • AttackForge Support
  • Release Notes
    • 2025
    • 2024
    • 2023
    • 2022
    • 2021
    • 2020
    • 2019
  • Core & Enterprise
    • Getting Started
      • How It Works
      • Requesting A Project
      • Creating & Updating Projects
      • Invite User To Project
      • View Project Team
      • Project Scope
      • Project Workspace
      • Project Notes
      • Project Pages
      • Test Cases
      • Creating Vulnerabilities
      • Updating Vulnerabilities
      • Review & QA
      • Attack Chains
      • Reporting
      • Retesting & Remediation
      • Notifications
      • Custom Fields & Forms
      • Vulnerability SLAs
      • User Settings
      • Login Redirects
    • Modules
      • Dashboard
      • Analytics
      • Vulnerabilities
      • Projects
      • Scheduling
      • Portfolios
      • Groups
      • Attack Chains
      • Assets
      • Writeups
      • Test Suites
      • Report Templates
        • Overview
        • Tutorial
        • Tips & Tricks
        • Troubleshooting
        • Template - Report Templates
        • Template - Tags
        • Template - Options
        • Template - Functions
        • Template - Filters
        • Template - Styles
        • Template - Tables
        • Template - Charts
        • Template - Conditions
        • ReportGen CLI
        • ReportGen Library
      • Users
      • Administration
      • Flows
      • Self-Service RESTful API
        • GETTING STARTED
        • EXPORTING TO CSV
        • ADVANCED QUERY FILTER
        • ActivateUser
        • AddProjectMembershipAdministrators
        • AddTestcaseToTestsuite
        • AddTestcasesToTestsuite
        • AddUserToGroup
        • ApproveProjectRequestById
        • ArchivePortfolio
        • ArchiveProject
        • CancelProjectRetestRound
        • CloneProject
        • CompleteProjectRetestRound
        • CreateAssetInLibrary
        • CreateGroup
        • CreatePortfolio
        • CreateProject
        • CreateProjectNote
        • CreateProjectRequest
        • CreateProjectTestCase
        • CreateProjectWorkspaceNote
        • CreateRemediationNote
        • CreateScope
        • CreateTestcaseNote
        • CreateTestsuite
        • CreateUser
        • CreateUsers
        • CreateVulnerability
        • CreateVulnerabilityBulk
        • CreateVulnerabilityLibraryIssue
        • CreateVulnerabilityWithLibrary
        • DeactivateUser
        • DownloadProjectTestCaseFile
        • DownloadProjectTestCaseNoteFile
        • DownloadProjectTestCaseWorkspaceNoteFile
        • DownloadVulnerabilityEvidence
        • DownloadVulnerabilityLibraryFile
        • DownloadWorkspaceFile
        • GetApplicationAuditLogs
        • GetAssets
        • GetAssetsByGroup
        • GetAssetInLibrary
        • GetAssetsInLibrary
        • GetCustomFieldsConfig
        • GetFormConfig
        • GetGroup
        • GetGroups
        • GetMostCommonVulnerabilities
        • GetMostFailedTestcases
        • GetMostVulnerableAssets
        • GetPortfolio
        • GetPortfolios
        • GetPortfolioStream
        • GetProjectAuditLogs
        • GetProjectById
        • GetProjects
        • GetProjectsAndVulnerabilities
        • GetProjectsByGroup
        • GetProjectMembershipAdministrators
        • GetProjectNotes
        • GetProjectReport
        • GetProjectReportData
        • GetProjectRequests
        • GetProjectRequestById
        • GetProjectTestcasesById
        • GetProjectVulnerabilitiesById
        • GetProjectWorkspace
        • GetTestsuiteById
        • GetTestsuites
        • GetUserByEmail
        • GetUserById
        • GetUserByUsername
        • GetUserAuditLogs
        • GetUserGroups
        • GetUserLoginHistory
        • GetUserProjects
        • GetUsers
        • GetVulnerabilityById
        • GetVulnerabilities
        • GetVulnerabilitiesByAssetName
        • GetVulnerabilitiesByGroup
        • GetVulnerabilityLibraryIssues
        • GetVulnerabilityRevisionHistory
        • InviteUserToProject
        • InviteUsersToProjectTeam
        • RejectProjectRequestById
        • RegenerateAPIKey
        • RemoveProjectMembershipAdministrators
        • RemoveProjectTeamMembers
        • RequestNewProjectRetest
        • RestoreProject
        • SendEmail
        • SendDailyCommencementEmail
        • SendDailyCompletionEmail
        • UpdateAssetInLibrary
        • UpdateCustomFieldsConfig
        • UpdateExecSummaryNotes
        • UpdateFormConfig
        • UpdateGroup
        • UpdatePortfolio
        • UpdateProjectById
        • UpdateProjectMembershipAdministrators
        • UpdateProjectNote
        • UpdateProjectRequestById
        • UpdateProjectRetestRound
        • UpdateProjectWorkspaceNote
        • UpdateScope
        • UpdateTestcase
        • UpdateTestcaseOnTestsuite
        • UpdateTestsuite
        • UpdateUserAccessOnGroup
        • UpdateUserAccessOnProject
        • UpdateUser
        • UpdateVulnerabilityById
        • UpdateVulnerabilityLibraryIssue
        • UpdateVulnerabilitySLAs
        • UpdateVulnerabilityWithLibrary
        • UploadTestcaseFile
        • UploadVulnerabilityEvidence
        • UploadVulnerabilityLibraryFile
        • UploadWorkspaceFile
      • Self-Service Events API
        • GETTING STARTED
        • Project Created
        • Project Updated
        • Project Request Created
        • Project Request Updated
        • Project Retest Requested
        • Project Retest Completed
        • Project Retest Cancelled
        • Vulnerability Created
        • Vulnerability Updated
        • Vulnerability Evidence Created
        • Vulnerability Evidence Updated
        • Vulnerability Remediation Note Created
        • Vulnerability Remediation Note Updated
    • AFScript
    • Access Control Matrix
    • Raising Support Tickets
    • Security
  • Contact
Powered by GitBook

Check YouTube for more tutorials: https://youtube.com/@attackforge

On this page
  • Parameters
  • Headers
  • Query
  • Example
  • Request
  • Response
  1. Core & Enterprise
  2. Modules
  3. Self-Service RESTful API

CreateProjectTestCase

This method can be used for the following functionality: Create a new Project Test Case

Parameters

The following URL, Headers and Parameters are required for requests to this API endpoint. Where a parameter is optional, it will be indicated. Otherwise treat all parameters as mandatory.

Headers

POST /api/ss/project/:id/testcase HTTP/1.1
Host: demo.attackforge.com
X-SSAPI-KEY: APIKey
Content-Type: application/json
Connection: close

Query

testcase (string)

Name of the test case. For example, "Test for XYZ".

Example:

{
   "testcase": "..."
}

assigned_to_user (string) (optional)

User Id to assign test case to.

Example:

{
   "assigned_to_user": "..."
}

assigned_to_assets (array of strings) (optional)

Project scope assets to assign test case to.

Example:

{
   "assigned_to_assets": ["..."]
}

status (string) (optional)

Status of the test case. Must match exactly one of the following: Tested, Testing In Progress, Not Tested, Not Applicable

Example:

{
   "status": "Tested"
}

linked_vulnerabilities (array of strings) (optional)

Vulnerability Ids to link to test case.

Example:

{
   "linked_vulnerabilities": ["...", "...", "..."]
}

code (string) (optional)

Test case code.

Example:

{
   "code": "..."
}

details (string) (optional)

Test case details. Supports limited HTML for styling.

Example:

{
   "details": "<p>...</p>"
}

execution_flow (array of objects) (optional)

Test case execution flow. Details supports limited HTML for styling.

Example:

{
   "execution_flow": [
      {
         "title": "...",
         "details": "<p>...</p>"
      }
   ]
}

tags (array of strings) (optional)

Test case tags.

Example:

{
   "tags": ["..."]
}

sort_order (integer) (optional)

Sort order when viewing testing case in the user interface.

Example:

{
   "sort_order": 1
}

project_testcase_custom_fields (array of objects) (optional)

Custom fields. Must include a key and value. Key must be unique and letters, number and underscores only.

Example:

{   
    "custom_fields": [
        {
            "key": "...", 
            "value": "..."
        }
    ]
}

testcase_custom_fields (array of objects) (optional)

Custom fields. Must include a key and value. Key must be unique and letters, number and underscores only.

Example:

{   
    "custom_fields": [
        {
            "key": "...", 
            "value": "..."
        }
    ]
}

Example

The following example is a cURL request to create a new project request.

Request

Include API Token instead of stars in 'X-SSAPI-KEY: ***************************************' parameter.

curl -X POST 'https://demo.attackforge.com/api/ss/project/66849b77950ab45e68fc7b48/testcase' -H 'Host: demo.attackforge.com' -H 'X-SSAPI-KEY: ***************************************' -H 'Content-Type: application/json' -H 'Connection: close' -d '{
  "testcase": "Test for X, Y, Z.", 
  "assigned_to_user": "66719e71f74c0fa64d278cbd", 
  "assigned_to_assets": [
    "6683caedada7972c8c28f1b3"
  ], 
  "status": "Tested", 
  "linked_vulnerabilities": [
    "66849b77950ab45e68fc7b48"
  ], 
  "code": "12345",
  "details": "<b>some details...</b>",
  "execution_flow": [
    {
      "title": "Step 1",
      "details": "<b>some details...</b>"
    }
  ],
  "tags": [
    "tag1"
  ],
  "project_testcase_custom_fields": [
    {
      "key": "some_field",
      "value": "some value..."
    }
  ],
  "testcase_custom_fields": [
    {
      "key": "some_other_field",
      "value": "some other value..."
    }
  ]
}'

Response

Response contains a project request object.

{
  "project_testcase": {
    "id": "...", 
    "created": "...", 
    "modified": "...",
    "status": "...",
    "testcase": {
      "id": "...",
      "code": "...",
      "testsuite": {
        "id: "..."
      }
    }
  }
}
PreviousCreateProjectRequestNextCreateProjectWorkspaceNote

Last updated 10 months ago

For more information visit

For more information visit

https://support.attackforge.com/attackforge-enterprise/getting-started/custom-fields-and-forms#using-custom-fields-with-apis
https://support.attackforge.com/attackforge-enterprise/getting-started/custom-fields-and-forms#using-custom-fields-with-apis