How to create issue from email/webpage form?

Sayyedul December 20, 2017

There is a php form in our website. After submitting the form, email will go to our company's email address (sample: support@company.com). Also, an issue is being created in Jira from that email/form. Those setting has been enabled already in jira. To send the email, an email of our company is to set in Form filed in the php. Without that gateway, message can't be send to our email address. So, the sample code is:

 

$fromName = $_POST['username'];
$fromEmail = $_POST['email'];
$mail->From = 'any@company.com';
$mail->FromName = 'Company';
$mail->addAddress('support@company.com', 'Company');
$mail->addReplyTo($fromEmail, $fromName);
$mail->Body    = "<p>You have got a email from <b>{$fromName}&lt;{$fromEmail}&gt;</b></p>";
$mail->Body .= "<p><b>The actual message is given bellow</b></p>";

 

The problem is, at jira, it says:

You have got a email from userName<user@gmail.com>

The actual message is given bellow

And it sets  our email address (any@company.com which we set in $mail -> From) as reporter in stead of user's email (user@gmail.com, the email we collect by $fromEmail)  for that issue. So, the problem is, when we reply at that issue, it goes to any@company.com instead of user's email address (user@gmail.com). How to fix this?

1 answer

0 votes
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2017
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2017

Is the user's email actually mentioned in the "from" mail section in your company mailbox which the JIRA reads, can you confirm that

Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2017

Also from the official docs, this is what is supported, without requiring the plugin. You have to use it while configuring the mail handler

Default Reporter
Specify the username of a default reporter, which will be used if the email address in the From: field of any received messages does not match the address associated with that of an existing JIRA user — for example, a JIRA username such as emailed-reporter

(info) Note:

This option is not available if the Create Users checkbox is selected.
Please ensure that the user specified in this field has the Create I ssues project permission for the relevant Project (specified above) as well as the Create Comments project permission for the other relevant projects to which this mail handler should add comments.
When an issue is created and this option is specified, the email message's From: field address is appended in a brief message at the end of the issue's Description field, so that the sender can be identified.

Sayyedul December 20, 2017

Thanks for your response. I don't have access to the company mailbox right now. I see all the messages at jira issue collector. I'll try to access the mailbox directly and confirm. By the way, for sending the message from website, phpMailer has been used: https://github.com/PHPMailer/PHPMailer/blob/master/examples/contactform.phps 

I haven't found any installed plugin for email handling. That means, it was configured without plugin probably.

existing-add-on.jpg.

Sayyedul December 20, 2017

By the way, here is the configuration what I have found in jira:

 

Screenshot from 2017-12-20 18-41-46.pngScreenshot from 2017-12-20 18-45-55.pngScreenshot from 2017-12-20 18-47-51.png

Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2017

As mentioned in the configuration "You haven't provided default reporter" , thus if the "from" email address is not mapped to any username then it will be ignored. Thus, your company address is mapped to some username which becomes the default repoter.

Sayyedul December 20, 2017

okay, but I don't want to set any default reporter. I want sender's email address as reporter. Sender can be new or any existing jira user. I want it to generate from the input of the form.

$fromEmail = $_POST['email'];

 What should I do then?

Sayyedul December 21, 2017

By the way, I've tried with checking Create Users checkbox. still no change!

 

Screenshot from 2017-12-21 18-05-03.png

Dieter Kollmannsberger April 15, 2020

Since a long time i look for a solution for your question.

I haven't found one.

You found anything that works for this?

I Need the same

Suggest an answer

Log in or Sign up to answer