View Issue Details

IDProjectCategoryView StatusLast Update
0016381mantisbtapi soappublic2013-10-01 16:05
Reportern3wtron Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionduplicate 
Product Version1.2.15 
Summary0016381: API to retrieve all issues for project version
Description

like mc_project_get_issue_headers_for_version( username, password, project_id, version,page_number, per_page )

Additional Information

I'm a python developer, I've written this (similar to mc_project_get_issue_headers), but I'm not sure if it's a good way to do that.

function mc_project_get_issue_headers_for_version( $p_username, $p_password, $p_project_id, $p_version,$p_page_number, $p_per_page ) {
global $g_project_override;

$t_user_id = mci_check_login( $p_username, $p_password );
if( $t_user_id === false ) {
    return mci_soap_fault_login_failed();
}
if( $p_project_id != ALL_PROJECTS && !project_exists( $p_project_id ) ) {
    return SoapObjectsFactory::newSoapFault( 'Client', "Project '$p_project_id' does not exist." );
}

$g_project_override = $p_project_id;;

if( !mci_has_readonly_access( $t_user_id, $p_project_id ) ) {
    return mci_soap_fault_access_denied( $t_user_id );
}

$t_filter = array(
    'show_version' => Array(
        '0' => $p_version,
    ),
    'dir' => 'DESC',
    'sort' => 'id',
);

$t_orig_page_number = $p_page_number < 1 ? 1 : $p_page_number;
$t_page_count = 0;
$t_bug_count = 0;

$t_rows = filter_get_bug_rows( $p_page_number, $p_per_page, $t_page_count, $t_bug_count, $t_filter, $p_project_id );
$t_result = array();

// the page number was moved back, so we have exceeded the actual page number, see bug #12991
if ( $t_orig_page_number > $p_page_number )
    return $t_result;

foreach( $t_rows as $t_issue_data ) {
    $t_result[] = mci_issue_data_as_header_array( $t_issue_data);
}

return $t_result;

}

Tagspatch

Relationships

duplicate of 0008657 closedcommunity SOAP API support for custom filters 

Activities

dregad

dregad

2013-09-18 05:31

developer   ~0038052

https://github.com/mantisbt/mantisbt/pull/93

grangeway

grangeway

2013-09-18 17:36

reporter   ~0038059

we shouldn't really be adding stuff like this, but allowing people to use/implement the filter api

rombert

rombert

2013-09-19 03:34

reporter   ~0038064

I agree unfortunately. Rather than adding a large number of query methods, we should wrap up the filter api ( see bug 0008657 ).

@n3wtron - thank you for taking the time to report and to implement this change, but we can't accept it as it is. If you're interested in helping us update Mantis to have a query API over SOAP, take a look at https://github.com/rombert/mantisbt/tree/soap-custom-filters and start a discussion on bug 0008657. Thanks for understanding.

n3wtron

n3wtron

2013-09-19 03:51

reporter   ~0038066

I'm sorry to have wasted your time, I will try to partecipate to the soap-custom-filters branch.
Thanks

rombert

rombert

2013-09-19 04:38

reporter   ~0038071

No time was wasted! I'm only happy that you're willing to contribute :-)