Access custom data in issue create override

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
smorley
Posts: 6
Joined: 27 Nov 2012, 17:40

Access custom data in issue create override

Post by smorley »

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?
smorley
Posts: 6
Joined: 27 Nov 2012, 17:40

Re: Access custom data in issue create override

Post by smorley »

Found my own solution:

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'] );
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.
Post Reply