Allow end user to see project baseline name

Document ID : KB000117148
Last Modified Date : 09/10/2018
Show Technical Document Details
Question:
I've had several users ask how they can see what the project baseline (BASE package) is. No option in Workbench for them to use. I want to create a script to allow them to find out. My test project OD_ARL was created from a snapshot but harview and harenvironment fields do not point to the snapshot name. Im looking at harenvironment.viewobjid and envobjid. then looking up viewobjid in harview. I am not able to figure out which tables to use to get the snapshot name to display as the baseline for OD_ARL.
Environment:
CA Harvest SCM all versions and platforms
Answer:
Here is a query that will generate a list of all items associated with the baseline of a specific project:
 
SELECT HARENVIRONMENT.ENVIRONMENTNAME,
  'BASELINE' as PACKAGENAME,
  HARPATHFULLNAME.PATHFULLNAME,
  HARITEMNAME.ITEMNAME,
  HARVERSIONS.MAPPEDVERSION
FROM HARENVIRONMENT
INNER JOIN HARVERSIONINVIEW ON HARENVIRONMENT.BASELINEVIEWID = HARVERSIONINVIEW.VIEWOBJID
INNER JOIN HARVERSIONS ON HARVERSIONS.VERSIONOBJID = HARVERSIONINVIEW.VERSIONOBJID
INNER JOIN HARPATHFULLNAME ON HARVERSIONS.PATHVERSIONID = HARPATHFULLNAME.VERSIONOBJID
INNER JOIN HARITEMNAME ON HARITEMNAME.NAMEOBJID = HARVERSIONS.ITEMNAMEID
WHERE HARENVIRONMENT.ENVIRONMENTNAME = ‘SampleProject’ /* <--- Project Name goes here */
ORDER BY PATHFULLNAME, ITEMNAME