Resolve Issue
  • 21 Feb 2024
  • 1 Minute to read
  • Dark
    Light
  • PDF

Resolve Issue

  • Dark
    Light
  • PDF

Article Summary

The Resolve Issue is an endpoint in ProGet's SCA Directory API that will set the status of an Issue to Resolved.

šŸš€ Quick Example: Setting an Issue Status to Resolved with Curl

This example sets the status of issue 3 to resolved in version 1.2.3 of a project myProject, authenticating with the API key abc12345:

curl -X POST  -H "X-ApiKey: abc12345" "https://proget.corp.local/api/sca/issues?project=myProject&version=1.2.3&number=3&resolve=true"

Request Specification

To resolve an issue, simply POST to the URL with an appropriate API Key.

POST /api/sca/issues?project=Ā«projectNameĀ»&version=Ā«releaseVersionĀ»&number=Ā«issueNumberĀ»&resolve=true

Setting an issue to resolved requires the project name (e.g. myProject), version (e.g. 1.2.3), and issue number (e.g. 2):

POST /api/sca/issues?project=myProject&version=1.2.3&number=2&resolve=true

Response Specification

ResponseDetails
200 (Success)indicates issue was resolved
400 (Invalid Input)indicates invalid or missing arguments; the body will provide some details as text
403 (Unauthorized API Key)indicates a missing, unknown, or unauthorized API Key; the body will be empty
500 (Server Error)indicates an unexpected error

Resolve all issues (Powershell)

This script resolves all issues of version 1.2.3 of project myProject:

$BaseUrl = "https://proget.corp.local"
$ProjectName = "myProject"
$ReleaseVersion = "1.2.3"
$ApiKey = "a1b2c3d4e5"

$ListApiUrl = "$BaseUrl/api/sca/issues?project=$ProjectName&version=$ReleaseVersion"
$ResolveApiUrl = "$BaseUrl/api/sca/issues?project=$ProjectName&version=$ReleaseVersion&number={0}&resolve=true"

$Headers = @{
    "X-ApiKey" = $ApiKey
}

function ListIssues {
    $response = Invoke-RestMethod -Uri $ListApiUrl -Headers $Headers -Method Get
    return $response
}

function ResolveIssue($issueNumber) {
    $url = $ResolveApiUrl -f $issueNumber
    $response = Invoke-RestMethod -Uri $url -Headers $Headers -Method Post
    return $response
}

$issues = ListIssues

if ($issues) {
    Write-Host "Resolving all issues..."
    foreach ($issue in $issues) {
        ResolveIssue $issue.number
        Write-Host "Issue $($issue.number) resolved."
    }
} else {
    Write-Host "No issues found."
}

Was this article helpful?