12 Replies Latest reply on May 18, 2016 6:33 PM by Bill Robinson

    blcli findLastRunKeyByJobKey: There are no job runs for the specified job id and version.

    Argyris Spinos

      Hello all,


      I have created below nsh script to export the patch analysis results for a given hostname:



      JOB_GROUP="/Windows/Patching Jobs/Patch Analysis Jobs"

      JOB_NAME="Windows 2012 Patch Analysis"

      blcli_execute PatchingJob getDBKeyByGroupAndName "${JOB_GROUP}" "${JOB_NAME}"

      blcli_storeenv JOB_DB_KEY  

      blcli_execute JobRun findLastRunKeyByJobKey "${JOB_DB_KEY}"

      blcli_storeenv JOB_RUN_KEY  

      blcli_execute JobRun jobRunKeyToJobRunId "${JOB_RUN_KEY}"

      blcli_storeenv JOB_RUN_ID

      blcli_execute Utility exportPatchAnalysisRun "${SERVER_NAME}" "${JOB_GROUP}" "${JOB_NAME}" "${JOB_RUN_ID}" "E:\Exports\ePAR.csv" "CSV"`


      When I run the job I get:

      Error    05/16/2016 17:11:45    Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: There are no job runs for the specified job id and version.


      If I try findLastRunKeyByJobKeyIgnoreVersion instead of findLastRunKeyByJobKey I get:


      Error    05/16/2016 17:37:27    /C/Program Files/BMC Software/BladeLogic/NSH/tmp/hostname_JOB/scripts/job__de381a35-384d-4d85-9329-0e8e0a3e0fea/976bb161-6168-47bd-bb26-6d63c0d404ed.script_DBKey-SJobKeyImpl-2638-4_exportComplianceDetailsServerReportWithServerName_Linux7.nsh:17: unmatched `



      Many thanks