View Issue Details

IDProjectCategoryView StatusLast Update
0028797mantisbtapi soappublic2023-03-20 13:57
ReporterLionelINT Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionunable to reproduce 
Product Version2.24.4 
Summary0028797: Missing Informations with mc_project_get_users and Error with mc_issue_add
Description

Hello Everybody,

My company was using an older version of Mantis.
We are using a software that we developped in Delphi. There was no problems with the code that I get with the WSDL.

We updated to Mantis 2.24.4, and since, I have 2 problems :
First, when i use mc_project_get_users, I get a list of user, but the fields real_name, and mail, are empty. However, when I connect with those account, there are data for those fields.
I checked the fields show_user_realname_threshold and show_user_email_threshold, but they seems correct. they are put to viewer.
I also got the new WSDL version.

Here is the code :

var
ada: AccountDataArray;
ad: AccountData;
begin
if Assigned( _MantisConnectPortType ) then begin
// On récupère la liste des utilisateurs associés au projet...
ada := _MantisConnectPortType.mc_project_get_users( _MantisUserName, _MantisPassword, pProjectId, -1 );
// On transfère dans la liste passée en arguments...
pList.Clear;
// On balaie la liste...
for ad in ada do begin
pList.AddObject( ad.real_name, ad );
// On libère l'objet...
// ad.Free;
end;

Second, when I try to create the ticket, i get this error :
User Not Allowed to Create issues.

Yet, the code hasn't changed, so I don't understand why I get this error.
Here is the code :
pvMantisID := _MantisConnectPortType.mc_issue_add( _MantisUSerName, _MantisPassword, anIssueData );

The code was correctly running with the older version, so I don't really know where to look for a solution.

Thanks for your help :)

TagsNo tags attached.

Activities

dregad

dregad

2021-06-14 09:29

developer   ~0065621

As far as I can tell, the API is working as expected (just tested on a fresh 2.24.4 install, after adding a test user to the project).

<?php
$s = new SoapClient( 'http://localhost/mantis/api/soap/mantisconnect.php?wsdl' );
$u = 'administrator';
$p = 'root';
print_r($s->mc_project_get_users($u, $p, 1));

Results

Array
(
    [0] => stdClass Object
        (
            [id] => 3
            [name] => tmgr
            [real_name] => Test Manager
            [email] => tmgr@localhost
        )

)

Make sure the user that makes the SOAP call has the required access level to view realname / email ($g_show_user_realname_threshold / $g_show_user_email_threshold). For example, using the above code snippet, replacing administrator/root by a viewer account (and default config settings), I get

Array
(
    [0] => stdClass Object
        (
            [id] => 3
            [name] => tmgr
        )

)

I would guess your mc_issue_add() error has the same root cause.

dregad

dregad

2023-03-05 05:04

developer   ~0067453

LionelINT,

You did not provide any feedback; I am therefore resolving this issue as "unable to reproduce".

Feel free to reopen the issue at a later time and provide the requested information.