HP ALM REST API - Get ALM Releases

Tutorial on how to get releases under a project in HP ALM using REST API. Includes browser method, VB and C# functions to get releases.

Tutorial on how to get releases under a project in HP ALM using REST API. Includes browser method, VB and C# functions to get releases

Tutorial on how to get releases under specified domain using HP ALM REST API.

Contents of this post.

Web Browser Method

  1. Open your favorite browser.
  2. Enter HP ALM REST API url: http://youralmserver:port/qcbin/api/authentication/sign-in
  3. Enter you ALM User Name and Password in the prompt that you get on navigating to the above url.
  4. Once successful authentication has occurred you will get a blank page.
  5. Now enter the url to get releases in the same browser window: http://youralmserver:port/qcbin/rest/domains/domainName/projects/projectName/releases (Domain name and Project name is case sensitive. Use the name as displayed in ALM.)
  6. Once you enter this url and press enter, you will get the list of releases under the project under the domain you specified in the url in xml format.

Sample Output

<?xml version="1.0" encoding="UTF-8"?>
<Entities TotalResults="1">
   <Entity Type="release">
         <Field Name="req-count">
         <Field Name="ver-stamp">
         <Field Name="description">
            <Value>Release Description</Value>
         <Field Name="scope-items-count">
         <Field Name="start-date">
         <Field Name="has-attachments">
            <Value />
         <Field Name="end-date">
         <Field Name="last-modified">
            <Value>2016-10-06 00:06:25</Value>
         <Field Name="name">
         <Field Name="milestones-count">
         <Field Name="id">
         <Field Name="parent-id">
      <RelatedEntities />

Code Method

Inputs Required
Prameter Example / Comments
HP ALM Base URL http://youralmurl:port/qcbin
HP ALM Domain Name

Enter the name of the domain from which you want the list of projects.

Refer HP ALM REST API - Get ALM Domains for details on how to get domains from ALM.

HP ALM Project Name

Enter the name of the project from which you want the list of releases.

Refer HP ALM REST API - Get ALM Projects for details on how to get projects from ALM.

Authentication CookieContainer

Pass the authentication cookiecontainer obtained while you authenticated.

Refer HP ALM REST API - Authentication for details.


In order to store Release information, create a class ProjectReleases
Refer respective code sections for class definition

VB Code to define ProjectReleases class

Friend Class ProjectReleases
 Public Property ReleaseId() As Integer
 Public Property ReleaseName() As String
 Public Property ReleaseStartDate() As Date
 Public Property ReleaseEndDate() As Date

 Public Overrides Function ToString() As String
  Return $"Release ID: {ReleaseId}{vbLf}Release Name: {ReleaseName}{vbLf}Release Start Date: {ReleaseStartDate}{vbLf}Release End Date: {ReleaseEndDate}{vbLf}{vbLf}"
 End Function
End Class

VB Code to get Releases under Project

Private Function GetProjectReleases(almBaseUrl As String, domainName As String, projectName As String, authenticationCookieContainer As CookieContainer) As IEnumerable(Of ProjectReleases)
 Dim projectReleasesList = New List(Of ProjectReleases)()
 Dim releaseRestApiUrl = $"{almBaseUrl}/rest/domains/{domainName}/projects/{projectName}/releases"
 Dim projectReleasesRequest = CType(WebRequest.Create(releaseRestApiUrl), HttpWebRequest)
 projectReleasesRequest.CookieContainer = authenticationCookieContainer
 Dim projectReleasesResponse = projectReleasesRequest.GetResponse()
 Dim projectReleaseResponseStream = projectReleasesResponse.GetResponseStream()
 If projectReleaseResponseStream Is Nothing Then
  Return projectReleasesList
 End If
 Using responseReader = New StreamReader(projectReleaseResponseStream)
  Dim responseString = responseReader.ReadToEnd()
  Dim responseXml = XElement.Parse(responseString)
  Dim entitiesXml = responseXml.Descendants("Entity")
  Dim releaseQuery = (From e As XElement In entitiesXml
       Let relId = e....Single(Function(x) x.Attribute("Name").Value = "id").Value
       Let relName = e....Single(Function(x) x.Attribute("Name").Value = "name").Value
       Let relStartDate = e....Single(Function(x) x.Attribute("Name").Value = "start-date").Value
       Let relEndDate = e....Single(Function(x) x.Attribute("Name").Value = "end-date").Value
       Select New ProjectReleases With {.ReleaseId = relId, .ReleaseName = relName, .ReleaseStartDate = relStartDate, .ReleaseEndDate = relEndDate}
  projectReleasesList = releaseQuery
 End Using
 Return projectReleasesList
End Function


Dim projectReleases = GetProjectReleases(almBaseUrl, "domainName", "projectName", authenticationCookieContainer)
For Each pr As ProjectReleases In projectReleases

C# Code to define ProjectReleases class

internal class ProjectReleases
 public int ReleaseId { get; set; }
 public string ReleaseName { get; set; }
 public DateTime ReleaseStartDate { get; set; }
 public DateTime ReleaseEndDate { get; set; }

 public override string ToString()
  return $"Release ID: {ReleaseId}\nRelease Name: {ReleaseName}\nRelease Start Date: {ReleaseStartDate}\nRelease End Date: {ReleaseEndDate}\n\n";

C# Code to get Releases under Project

private static IEnumerable GetProjectReleases(string almBaseUrl, string domainName,
 string projectName, CookieContainer authenticationCookieContainer)
 var projectReleasesList = new List();
 var releaseRestApiUrl = $"{almBaseUrl}/rest/domains/{domainName}/projects/{projectName}/releases";
 var projectReleasesRequest = (HttpWebRequest)WebRequest.Create(releaseRestApiUrl);
 projectReleasesRequest.CookieContainer = authenticationCookieContainer;
 var projectReleasesResponse = projectReleasesRequest.GetResponse();
 var projectReleaseResponseStream = projectReleasesResponse.GetResponseStream();
 if (projectReleaseResponseStream == null) return projectReleasesList;
 using (var responseReader = new StreamReader(projectReleaseResponseStream))
  var responseString = responseReader.ReadToEnd();
  var responseXml = XElement.Parse(responseString);
  var entitiesXml = responseXml.Descendants("Entity");
  var releaseQuery = (from entity in entitiesXml
       select entity.Descendants("Field")
    into releaseFields
       select releaseFields as IList ?? releaseFields.ToList()
    into relElements
       let relId = relElements.Single(x => x.Attribute("Name").Value == "id").Value
       let relName = relElements.Single(x => x.Attribute("Name").Value == "name").Value
       let relStartDate = relElements.Single(x => x.Attribute("Name").Value == "start-date").Value
       let relEndDate = relElements.Single(x => x.Attribute("Name").Value == "start-date").Value
       select new ProjectReleases { ReleaseId = int.Parse(relId), ReleaseName = relName, ReleaseStartDate = DateTime.Parse(relStartDate), ReleaseEndDate = DateTime.Parse(relEndDate)})
  projectReleasesList = releaseQuery;
 return projectReleasesList;


var projectReleases = GetProjectReleases(almBaseUrl, "domainName", "projectName", authenticationCookieContainer);
foreach (var pr in projectReleases)

Sample Output

Release ID: 1003
Release Name: Release1
Release Start Date: 05-12-2015
Release End Date: 05-01-2016

Release ID: 1004
Release Name: Release2
Release Start Date: 05-12-2015
Release End Date: 05-01-2016

Release ID: 1005
Release Name: Release3
Release Start Date: 05-12-2015
Release End Date: 05-01-2016
  • Tip

    You can get additional release details from other fields available in ALM. Add fields to the class and release query in code.



    AngularJS,3,Automation Testing,8,Blue Prism,1,CSharp,5,Disqus,1,Excel,3,Excel Addin,1,HP ALM,5,HTML5,1,ISTQB,2,Java Script,2,Manual Testing,7,Photography,1,Quiz,2,REST API,5,Robotic Process Automation,2,RPA,2,Testing,15,UFT,8,UiPath,1,VB,5,VBScript,1,VSTO,1,Wordpress,1,
    Aneejian: HP ALM REST API - Get ALM Releases
    HP ALM REST API - Get ALM Releases
    Tutorial on how to get releases under a project in HP ALM using REST API. Includes browser method, VB and C# functions to get releases.
    Loaded All Posts No posts found VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU ARCHIVE SEARCH ALL POSTS No post found which matches with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy