Assign custom field in EVENT_REPORT_BUG_DATA

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
kaotul
Posts: 3
Joined: Oct 25, 2016 4:03 am

Assign custom field in EVENT_REPORT_BUG_DATA

Post by kaotul »

class ... {

...
function init() {
plugin_event_hook( 'EVENT_REPORT_BUG_DATA', 'setFormalDate' );
}
}

function setFormalDate( $p_event, $p_bug_data ) {
$p_bug_data->due_date = time();
$p_bug_data->custom_Formal_Answer = time();
return $p_bug_data;
}
}

Only native column can be assigned. Nothing happen in custom field.

Note:
custom field
Name: Formal Answer
Type: date
Display When Reporting Issues: checked
kaotul
Posts: 3
Joined: Oct 25, 2016 4:03 am

Re: Assign custom field in EVENT_REPORT_BUG_DATA

Post by kaotul »

For your info:

This custom filed has been linked to all projects.


Thank your for any advice.
//Kaotul
cproensa
Posts: 8
Joined: Aug 24, 2015 6:37 am

Re: Assign custom field in EVENT_REPORT_BUG_DATA

Post by cproensa »

kaotul
custom fields are not part of the BugData object
you have to set custom fields using api calls
kaotul
Posts: 3
Joined: Oct 25, 2016 4:03 am

Re: Assign custom field in EVENT_REPORT_BUG_DATA

Post by kaotul »

cproensa wrote:kaotul
custom fields are not part of the BugData object
you have to set custom fields using api calls

Thank you very much. I appreciate it.
//Kaotul
Post Reply