REST API - Requirement Test Coverage

Thursday, September 22, 2022
Avatar

I am trying to connect testcases to requirements, using the post API: https://api.inflectra.com/spira/services/v6_0/RestServiceOperation.aspx?uri=projects%2f%7bproject_id%7d%2frequirements%2ftest-steps&method=POST

The call itself is succesfull but  test coverage / requirement coverage in spiraplan remain empty. 

 

Using the association Post API can link them but this is not used in test coverage: https://api.inflectra.com/spira/services/v6_0/RestServiceOperation.aspx?uri=projects%2f%7bproject_id%7d%2fassociations&method=POST

Is there some issue with the API call or perhaps a prerequisite im missing? The API calls are done from c# using HttpClient.

4 Replies
Friday, September 23, 2022
Avatar
re: jgeerligs Thursday, September 22, 2022

I think you are using the wrong endpoint. You are using the Requirement -> Test Steps one, not test cases.

Please use this one:

https://api.inflectra.com/Spira/Services/v6_0/RestServiceOperation.aspx?uri=projects%2f%7bproject_id%7d%2frequirements%2ftest-cases&method=POST

Friday, September 23, 2022
Avatar
Saturday, September 24, 2022
Avatar
re: jgeerligs Friday, September 23, 2022

OK then please log a support ticket with the exact payload you are using:

https://www.inflectra.com/Support/Ticket/List.aspx

Tuesday, September 27, 2022
Avatar
re: inflectra.david Friday, September 23, 2022

Thanks for the help, I made a ticket and got the answer.

It seems the postasjsonasync method of the httpclient in c# sets the content-type to "text/html", which caused the issue. After making sure the content-type is set to "application/json" it works.

Statistics
  • Started: Thursday, September 22, 2022
  • Last Reply: Tuesday, September 27, 2022
  • Replies: 4
  • Views: 90