View Issue Details

IDProjectCategoryView StatusLast Update
0034747mantisbtapi restpublic2024-10-06 16:19
Reporterjacques.chen Assigned Todregad  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionno change required 
Product Version2.26.3 
Summary0034747: API REST, POST Create a project
Description

I'm trying to implement API REST.

By following the documentation at : https://documenter.getpostman.com/view/29959/mantis-bug-tracker-rest-api/7Lt6zkP#16677869-82ac-50a0-e69f-c33986fbcf5f

I have an issue with the POST request for the creation of a project.
I use this payload :

{
   "name": "test1231231",
   "status": {
      "name": "development"
    },
    "description": "",
    "file_path": "/tmp/",
    "view_state": {
      "name": "private"
    },
    "enabled": true
}

Each time i try with a different name, i get an ERROR 500.
If i try to do the same call (with the same name), i get an ERROR 400 : {"message":"Project name is not unique","code":701,"localized":"A project with that name already exists. Please go back and enter a different name."}

So with the first call, the project is created successfully, however i dont get a return code 201 with the project_id.
by checking apache2 error.log, i have this line :

PHP Fatal error: 200 in /var/www/mantisbt/core/gpc_api.php on line 68

I use php 8.2.20

TagsNo tags attached.

Activities

dregad

dregad

2024-09-24 11:01

developer   ~0069273

It works for me, no errors.

Error 200 (ERROR_GPC_VAR_NOT_FOUND), can happen when trying to retrieve an HTTP parameter with gpc_get*() functions without a default value, but to my knowledge there is no such call in this context.

Are you using any plug-ins, or did you customize MantisBT code ?

jacques.chen

jacques.chen

2024-09-24 11:19

reporter   ~0069274

Both.
I'll start from a fresh install and try to find which plugin/custom code is causing this issue.

dregad

dregad

2024-09-25 19:23

developer   ~0069280

Based on your feedback, the problem you're facing is most likely not a MantisBT bug, but caused by a 3rd-party plugin or changes to MantisBT source code. I am therefore resolving this as "no change required".

Please use the forums to get support on customizing and using MantisBT (refer to https://mantisbt.org/support.php for links and further details).