Skip to main content

Jira

Pre-post parameters filter

Allows modifying form field data before it's sent to external integration. Useful if you want to make values derived from the sent data, or add new fields.

add_filter('es_forms_integrations_jira_pre_post_params', 'getIntegrationPrePostParams', 10, 2);

/**
* Modifies form field data before it's sent to external integration.
*
* @param array<string, mixed> $params Array of params.
* @param string $formId Form ID.
*
* @return array<string, mixed>
*/
function getIntegrationPrePostParams(array $params, string $formId): array
{
$formSubmissionPageLt = $params['form_submission_page_lt']['value'] ?? '';

if ($formSubmissionPageLt) {
$params['ib-submission-source'] = [
'name' => 'ib-submission-source',
'value' => $formSubmissionPageLt,
'type' => 'text',
'internalType' => '',
];
}

return $params;
}