Jira API POST request + WPForms

  • Hello everyone, I am currently building a form for my WordPress website. After pressing the Submit button, it will create an issue on my Jira board.

    Below is the code for that form

    add_action( 'wpforms_process_complete', 'sendingDataToJava', 10 );
    
    function sendingDataToJava( $fields, $entry, $form_data, $entry_id) {
    	$user = '<my jira email>';
    	$token = '<my jira api token>';
        if (form_data[id] == 3809) {
          $api_url = 'https://<my jira url>/rest/api/2/issue/';
          $body = '
    {
    $fields: array(
    “project”=> array(
    “key”=> “BBB”
    ),
    “summary”=> “New Applicant”,
    “description”=> “null”,
    “customfield_10034″=> $fields[4][‘value’],
    “customfield_10035″=> $fields[5][‘value’],
    “issuetype”=> array(
    “name”=> “Task”
    )
    ),
    $args = ‘headers’ => array(‘Authorization’ => ‘Basic ‘ . base64_encode( $user . ‘:’ .$token ))
    }';
    $request = wp_remote_post( $api_url, $body );
    
    };
    }

    And I have two errors after submitting:

    1. POST 500
    2. WPForms AJAX submit error
  • Also, note in mind that I can use any third party plugins to work on this (it will be easier if my boss lets me)

    I have researched for Contact Form 7, Jira Webhook and many more but it is so hard to work on since there is hardly any tutorial

    Thank everybody in advance!

  • Hello there,

    Many thanks for reaching out.

    Are you able to confirm the URL of the website that you need assistance with please?

    Please note that these forums are for WordPress.com hosted sites only. If your site is using the open-source WordPress.org software you need to seek help at these forums:
    https://wordpress.org/support/forums/

  • Hello there,

    Many thanks for reaching out.

    Are you able to confirm the URL of the website that you need assistance with please?

    Please note that these forums are for WordPress.com hosted sites only. If your site is using the open-source WordPress.org software you need to seek help at these forums:
    https://wordpress.org/support/forums/

  • Hello and thanks for your reply

    Here is the website that I am working on
    Here

  • Hello there,

    Many thanks for that link.

    We’re unable to help with this site as this is not hosted with WordPress.com.

    You may wish to reach out to the plugin developers for contact form 7 or the forums above.

    I hope this helps.

  • The topic ‘Jira API POST request + WPForms’ is closed to new replies.