Harvest

Expand all | Collapse all

I need to find what was the last date a project was used?

Jump to Best Answer
  • 1.  I need to find what was the last date a project was used?

    Posted 02-26-2018 02:53 PM

    Hello,

     

    When was the last date a harvest project was used?

     

    Regards,

     

    Tania Moreno R.



  • 2.  Re: I need to find what was the last date a project was used?

    Posted 02-27-2018 07:58 AM

    Hello,

     

    I think to query harpackages to get this information. Right?

     

    Regards,

     

    Tania Moreno R.



  • 3.  Re: I need to find what was the last date a project was used?

    Posted 02-27-2018 10:27 AM

    Hi Tania,

    This question came up quite a few times on customer sites.  You need to define exactly what you mean by "used", but it will normally be either the last time a new version was created in the project or the last time a package was created, promoted or demoted.  Detecting the last time code was checked-out for browse is not possible AFAIK.

    Here is a quick query that will list all projects with packages created in the last two months:

    select distinct e.environmentname from harenvironment e, harpackage p where p.envobjid=e.envobjid and p.creationtime > sysdate-62;

    If you want to get the last time, you can simply do a max() on the creationtime (or execdtime for promotes/demotes) and tie the envobjid back to the project you want to examine.

    Let me know if you need more help and I will try and write some examples for you.

    Best regards,

         Robert



  • 4.  Re: I need to find what was the last date a project was used?

    Posted 03-02-2018 11:39 AM

    Thanks Robert.



  • 5.  Re: I need to find what was the last date a project was used?
    Best Answer

    Posted 02-27-2018 11:52 AM

    Hello Tania,

     

    This query will give you the date of the last version created for a project:

     

    SELECT
      HARENVIRONMENT.ENVIRONMENTNAME,
      MAX(DISTINCT HARVERSIONS.MODIFIEDTIME) AS LAST_USED_DATE
    FROM
      HARENVIRONMENT
      INNER JOIN HARVIEW ON HARENVIRONMENT.ENVOBJID = HARVIEW.ENVOBJID
      INNER JOIN HARVERSIONINVIEW ON HARVIEW.VIEWOBJID = HARVERSIONINVIEW.VIEWOBJID
      INNER JOIN HARVERSIONS ON HARVERSIONS.VERSIONOBJID = HARVERSIONINVIEW.VERSIONOBJID
    WHERE HARENVIRONMENT.ENVIRONMENTNAME = 'MyProjectName'  /* <---- Project Name goes here */
    GROUP BY   HARENVIRONMENT.ENVIRONMENTNAME

     

    It might provide a good indicator of the last time the project was used.

     

    Let me know if this helps.

     

    Thanks



  • 6.  Re: I need to find what was the last date a project was used?

    Posted 03-02-2018 11:38 AM

    Hello Melinda,

     

    This script works. 

     

    Thanks a lot!

     

     

    Tania Moreno R.