Unable to get Issue.

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
pavan4610
Posts: 1
Joined: 12 Apr 2018, 10:10

Unable to get Issue.

Post by pavan4610 »

I am using MantisBT and mantisconnect-client-api-1.1.1.1 in java. From Java I want to get a list of issues created by a user and create new issue. I am able to connect and get the project with below line of code IProject[] projects = session.getAccessibleProjects(); But when I try to get issues or filters it gives an error. When I try to get the issue with below line of code, I get error shown below,

IIssue[] issues = session.getProjectIssues(projects[0].getId());


Error: org.mantisbt.connect.MCException: org.xml.sax.SAXException: Invalid element in org.mantisbt.connect.axis.AttachmentData - user_id

Exception is org.mantisbt.connect.MCException: Access denied for user Pavan.K.
barbr555
Posts: 1
Joined: 27 Oct 2019, 10:37

Re: Unable to get Issue.

Post by barbr555 »

I would like to know the good practices to get a new REST api function published in the mantis plugin context, reusing the mantis API REST core infrastructure. It could be a new service (based on my custom schema), or reusing an existing core api function to incorporate to my plugin an existing one (ie. as an AJAX call). I am not sure, but mantis REST API and SOAP API implementations, seems to be a subset of methods which narrows the core api, using a different infrastructure on each case.

I do not know how to import the current REST API infrastructure to create new REST services in the plugin architecture. I tried to create new services by creating and configuring these in the core code, and it works, but I do not want to follow that path.

In Java, or .NET, I use to get whatever I want to be published from my business layer as a JSON or SOAP service, just specifying attributes to methods, which includes protocol and security considerations. Alternatively, I can also use frameworks like spring, which allows me to publish whatever business layer method as a service (SOAP or REST) with a few XML configuration lines. Also, I wrote about this at [Changed By Admin as there is no Mantis related content behind the link]. When I start the development of a new project, I do not use to have complete information about future publishing requirements, and this kind of implementation, allows me to decide it later, in a scalable and simple way, and respecting existing business transactionality with independency of the client consuming the service.

The best solution I found, is to create in my plugin files folder, REST service pages, and: add the mantis context security considerations, receive the function to be invoked as a parameter (to be processed at the beginning of the request), the form data to be processed, and response with the right JSON result, but I do not like it either and seems to be botched.
Post Reply