Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Getting CSRF check failed

Zephyr QA August 20, 2024

 

@Api(value = "TestCase File Import Resource API(s)", description = "Following section describes the rest resources pertaining to IssueImporterResouece")
@Path("importer")
@AnonymousSiteAccess
@DoesNotRequireXsrfCheck
@UnrestrictedAccess
@ZSFilterNameBinding
//@ResourceFilters(ZFJApiFilter.class)
public class IssueImporterResource {



@Inject
public IssueImporterResource(JiraAuthenticationContext authContext, IssueImporterResourceDelegate issueImportResourceDelegate) {
super();
this.authContext = authContext;
this.issueImportResourceDelegate = issueImportResourceDelegate;
}


@ApiOperation(value = "Import test cases into Jira from Excel File/s for a project", notes = "Import project test cases into Jira ")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Path("/fieldMapping")
@POST
public Response extractIssueMapping(@Context HttpServletRequest request) {
Response authRes = handleAuthRes();
if (authRes != null) return authRes;
if (ZephyrUtil.CheckMemoryUsage(authContext)) return JiraUtil.buildErrorResponse(Status.SERVICE_UNAVAILABLE, null,
authContext.getI18nHelper().getText("zephyr-je.service.temporary.unavailable.message")
, null);
Map<String, String> mapping = null;
try {
mapping = issueImportResourceDelegate.extractIssueMapping(request);
} catch (Exception e) {
return JiraUtil.buildErrorResponse(Response.Status.BAD_REQUEST, null, e.getMessage(), null);
}
return Response.status(Status.OK).entity(mapping).build();
}

}



When i am trying to run above API, I am getting 403 XSRF check failed. This is happening after upgradation of Jira 10. We are facing problem in fixing the above.
Can anyone please help me with the above?

We are using Java 17 only. 

 

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events