What is PackageReferenceName when creating a Release?

When creating a release via the API interface, you can provide a value called SelectedPackages. This is an array of objects. Each one of these entries into the SelectedPackages array can have the following properties:

ActionName
PackageReferenceName
Version

I think I have a fair idea of ActionName (the name of the step that is going to use the package) and Version (the version number the package is registered with).

But I am not sure what PackageReferenceName is, and example scripts I have seen just fill it in from some kind of template (that my script is not using).

When I create a package via the API, this is an example of the response that I can get back:

{
  "Id": "packages-MyApplicationNameHere.1.0.0.109",
  "PackageSizeBytes": 4701567,
  "Hash": "7d302b19bd35e49d67930f4cae1987e4c412fd14",
  "NuGetPackageId": "MyApplicationNameHere",
  "PackageId": "MyApplicationNameHere",
  "NuGetFeedId": "feeds-builtin",
  "FeedId": "feeds-builtin",
  "Title": "MyApplicationNameHere",
  "Summary": null,
  "Version": "1.0.0.109",
  "Description": null,
  "Published": "2023-06-29T13:50:47.443-06:00",
  "ReleaseNotes": null,
  "FileExtension": ".zip",
  "PackageVersionBuildInformation": null,
  "Links": {
    "Self": "/api/Spaces-1/packages/packages-MyApplicationNameHere.1.0.0.109",
    "AllVersions": "/api/Spaces-1/packages?nuGetPackageId=MyApplicationNameHere",
    "Feed": "/api/Spaces-1/feeds/feeds-builtin",
    "Raw": "/api/Spaces-1/packages/packages-MyApplicationNameHere.1.0.0.109/raw"
  }
}

My guess is that PackageReferenceName matches to either Id or PackageId. But I am not sure which.

What value should I be using for PackageReferenceName?

Hi @OctopusSchaff!

Great to hear from you. In this regard, your PackageReferenceName points to the name of the package, as you see it in Library → Packages. So, from your example above, you’d want the PackageId/Title in your post.

SelectedPackages":[{"ActionName":"My Deployment Step","Version":"1.0.0.109","PackageReferenceName":"MyApplicationNameHere"}]}

As Octopus is API first, you can use your browser’s dev tools to inspect the API calls being made if you ever want to verify POST bodies or GET parameters, etc.
I hope this helps!

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.