Page 1 of 1

REST API - getting Mantis Issue ID of newly added Issue?

Posted: 18 Mar 2024, 20:53
by acoder2020
Is it possible to retrieve the newly added ID from a newly added Issue via REST API?

For clarification, I am adding the Issue via REST. I want to add notes under it (also via REST) but need an Issue ID for posting the notes.

Re: REST API - getting Mantis Issue ID of newly added Issue?

Posted: 18 Mar 2024, 21:17
by atrol
The ID is part of the response that you get when creating the issue.
See the example response at https://documenter.getpostman.com/view/ ... 9f9205a954

Re: REST API - getting Mantis Issue ID of newly added Issue?

Posted: 19 Mar 2024, 15:15
by acoder2020
Yep, this works perfectly (in PHP)

Code: Select all

$arr_response = json_decode($response,true);
$issue_id = $arr_response['issue']['id'];

echo "<p>issue_id $issue_id<br>";