Jump to content

Search the Community

Showing results for tags 'download'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Hornbill Platform and Applications
    • OpenForWork
    • Announcements
    • Blog Article Discussions
    • General Non-Product Discussions
    • Application Beta Program
    • Collaboration
    • Employee Portal
    • Service Manager
    • IT Operations Management
    • Project Manager
    • Supplier Manager
    • Customer Manager
    • Document Manager
    • Timesheet Manager
    • Live Chat
    • Board Manager
    • Mobile Apps
    • System Administration
    • Integration Connectors, API & Webhooks
    • Performance Analytics
    • Hornbill Switch On & Implementation Questions
  • About the Forum
    • Announcements
    • Suggestions and Feedback
    • Problems and Questions
  • Gamers Club's Games
  • Gamers Club's LFT

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Organisation


Location


Interests


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype

Found 2 results

  1. I have two separate scripts: # Define output stream type [OutputType([object])] # Define runbook input params Param ( # API Params #[Parameter (Mandatory= $true)] [string] $reportId = "842", [string] $outputFormat, [string] $runtimeParameter, [string] $comment, [string] $publish ) # Add XMLMC params Add-HB-Param "reportId" $reportId $false Add-HB-Param "outputFormat" $outputFormat $false Add-HB-Param "runtimeParameter" $runtimeParameter $false Add-HB-Param "comment" $comment $false Add-HB-Param "publish" $publish $false # Invoke XMLMC call, output returned as PSObject $xmlmcOutput = Invoke-HB-XMLMC "reporting" "reportRun" $exceptionName = "" $exceptionSummary = "" # Read output status if($xmlmcOutput.status -eq "ok") { if($xmlmcOutput.params.runId -and $xmlmcOutput.params.runId -ne ""){ $runId = $xmlmcOutput.params.runId } if($xmlmcOutput.params.exceptionName -and $xmlmcOutput.params.exceptionName -ne ""){ $exceptionName = $xmlmcOutput.params.exceptionName $exceptionSummary = $xmlmcOutput.params.exceptionDescription } } # Build resultObject to write to output $resultObject = New-Object PSObject -Property @{ Status = $xmlmcOutput.status Error = $xmlmcOutput.error ExceptionName = $exceptionName ExceptionSummary = $exceptionSummary runId = $runId } if($resultObject.Status -ne "ok" -or $exceptionName -ne ""){ Write-Error $resultObject } else { Write-Output $runId } This generates a run ID for a report which downloads successfully if I manually enter the run ID into: # Define output stream type [OutputType([object])] # Define runbook input params Param ( # API Params #[Parameter (Mandatory= $true)] [string] $runId = "45234" ) # Add XMLMC params Add-HB-Param "runId" $runId $false # Invoke XMLMC call, output returned as PSObject $xmlmcOutput = Invoke-HB-XMLMC "reporting" "reportRunGetStatus" $exceptionName = "" $exceptionSummary = "" # Read output status if($xmlmcOutput.status -eq "ok") { if($xmlmcOutput.params.reportRun -and $xmlmcOutput.params.reportRun -ne ""){ $reportRun = $xmlmcOutput.params.reportRun } if($xmlmcOutput.params.files -and $xmlmcOutput.params.files -ne ""){ $files = $xmlmcOutput.params.files } if($xmlmcOutput.params.delivery -and $xmlmcOutput.params.delivery -ne ""){ $delivery = $xmlmcOutput.params.delivery } if($xmlmcOutput.params.exceptionName -and $xmlmcOutput.params.exceptionName -ne ""){ $exceptionName = $xmlmcOutput.params.exceptionName $exceptionSummary = $xmlmcOutput.params.exceptionDescription } } # Build resultObject to write to output $resultObject = New-Object PSObject -Property @{ Status = $xmlmcOutput.status Error = $xmlmcOutput.error ExceptionName = $exceptionName ExceptionSummary = $exceptionSummary reportRun = $reportRun files = $files delivery = $delivery } if($resultObject.Status -ne "ok" -or $exceptionName -ne ""){ Write-Error $resultObject } else { $reportFileLink = $files | Select -ExpandProperty name $reportID = "123" $HornbillKey = "xxxxxxx" [string] $url = "https://mdh-p01-api.hornbill.com/iposervicedesk/dav/" + "reports/" + $reportID + "/" + $reportFileLink $headers = @{} if ($HornbillKey -ne $null) { $headers["Authorization"] = "ESP-APIKEY $HornbillKey" } try { $result = Invoke-WebRequest -Uri $url -Method GET -OutFile "./$reportFileLink" -Headers $headers } Catch { Write-Error $_.Exception.Message } } What I want to do is parse the run ID that is output from the first piece of code so that the report downloads without having to manually specify the run ID to the second piece of code. . "./script1.ps1" - runId $runId Doesn't have the desired effect.
  2. Hi, I have a bit of a random question... I noticed we can run a report using the API (which is great! ). The output is a run ID. Reusing this run ID, is there a way to download directly into CSV the report programmatically? For example: https://admin.hornbill.com/<instance>/app/com.hornbill.servicemanager/reporting/<Report ID>/reports/<Report ID>_<Run ID>.csv? That would be super useful in terms of integration...
×
×
  • Create New...