Experience with 'generated reports' REST API?

Friday, November 8, 2019
Avatar

For our build pipeline, I'm investigating the possibility to generate Spira reports by API so a design file can be compiled as part of the release process. It seems the REST service provides an API to do this, as described in 

Generated Report API

However, the documentation is a bit sketchy, and I am at lost how to use it exactly. 

The 'generated report ID' I should use is an integer, and I thought it referred to the ID of the template for the report. However, if I provide this, I get the response 

"The specified artifact was not found"

Am I correct in thinking that this API should trigger a report generation for the given project and report template ID?  I also tried storing a generated report in Spira, which gives me a different ID for the stored report, but using this still gives the same result.

This other API is meant to check on the status of the report generation, but it requires a 'report generation GUID'  I'm not sure how to obtain. I'm just missing a good example here... Anyone has experience using this service?

 

 

 

 

3 Replies
Friday, November 8, 2019
Avatar
re: dl.pie Friday, November 8, 2019

After a bit more searching, I found that the missing piece was the 'Saved Reports' API which has to be used first (for the actual report generation)...

I store a (shared) report in Spira, then I can retrieve its ID by the reports/saved API. 

However, when using this ID to actually generate the report, I get a 'Method not allowed' page. I do have System Administrator credentials. Any thoughts on what is wrong? Or is this specific API blocked for cloud users?

 

 

Friday, November 8, 2019
Avatar
re: dl.pie Friday, November 8, 2019

Hello

This is a brand new API method that was added in v6.2.1.1, so apologies that it as not well documented as some other API functions.

You should use:

  • POST: projects/{project_id}/reports/saved/{saved_report_id}/generate (to generate the saved report)
    • Returns an alphanumeric GUID to use with the next function
  • GET: projects/{project_id}/reports/generated?report_generation_id={report_generation_id} to check the status of the report
    • When it returns an integer > 0 this is the ID of the generated report
  • GET: projects/{project_id}/reports/generated/{generated_report_id} to get the generated report

Please log a help desk ticket that does not work for you and we'd be happy to assist further.

Regards

David

Saturday, November 9, 2019
Avatar
re: inflectra.david Friday, November 8, 2019

We just added this article to provide more information:

https://www.inflectra.com/Support/KnowledgeBase/KB494.aspx

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Friday, November 8, 2019
  • Last Reply: Saturday, November 9, 2019
  • Replies: 3
  • Views: 9547