I would like to test and manipulate custom data in the custom_function_override_issue_create_validate function.
I found I can do this with the standard fields ( $p_new_issue_data->description = 'I can override this value';)
But I can't see to find out how to access the custom fields, eg currency, neither ->currency nor ->custom_currency seem to exist for $p_new_issue_data.
How can I access those fields at this point?
Access custom data in issue create override
Moderators: Developer, Contributor
Re: Access custom data in issue create override
Found my own solution:
Unfortunately, while this lets me validate the custom fields it does not let me update them. Looks like I'll need to us a plugin to trigger off the new issue event.
Code: Select all
$t_id = custom_field_get_id_from_name('currency');
$t_def = custom_field_get_definition( $t_id );
$t_value = gpc_get_custom_field( "custom_field_$t_id", $t_def['type'], $t_def['default_value'] );