Spira API, deleted or no access or other reasons?

Thursday, March 30, 2023
Avatar

Hello all!

 

Is there a way to understand through API that task/incident was deleted from the system? To distinguish it from the situation when user doesn't have permissions to that project.

 

Let me add more details.

Initially we have only ticket name, for example: TK:10000 or IN:20000

So, we use this API to extract ticket's project_id first: https://eti.spiraservice.net/services/v6_0/RestService.svc/system/artifact-types/3/120631/project-id

Only after that using additionally project_id value for ticket we can use following APIs to extract ticket details:

https://eti.spiraservice.net/services/v6_0/RestService.svc/projects/16/incidents/32890

https://eti.spiraservice.net/services/v6_0/RestService.svc/projects/15/tasks/41230

 

When we use API to extract project_id there are only 2 cases of HTTP response: 200 or 400

In case of error HTTP 400 we receive following error text, which do not give information if ticket was deleted or user have no access to ticket/project: "The server encountered an error processing the request. The exception message is 'Incident 17730 doesn't exist in the system.'. See server logs for more details. The exception stack trace is:

at Inflectra.SpiraTest.Business.IncidentManager.RetrieveById(Int32 incidentId, Boolean includeResolutions, Boolean includeDeleted, Boolean includeTestRunSteps) at Inflectra.SpiraTest.Web.Services.v6_0.RestService.System_GetProjectIdForArtifact(String artifact_type_id, String artifact_id) at SyncInvokeSystem_GetProjectIdForArtifact(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)"

 

Maybe there is another API we should use to check if ticket was deleted or user has no access to ticket/project taking into account that we initially have ticket type (IN, TK) and ticket number only?

 

Best,

Yelzhan

1 Replies
Monday, April 3, 2023
Avatar
re: yelzhan Thursday, March 30, 2023

I believe for security reasons we don't distinguish for the project ID request between it being deleted and it not being accessible.

I would recommend logging a support ticket if you need more assistance.

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: Thursday, March 30, 2023
  • Last Reply: Monday, April 3, 2023
  • Replies: 1
  • Views: 466