Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to assign an email to a reporter via Rest Api in javascript

Josiah
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 29, 2023

I'm trying to create a ticket via Javascript via the Rest Api. So far I've gotten everything working except for creating a ticket when the email hasn't already existed in our system. For instance, when I or a registered customer creates an issue ticket, the reporter is then registered with the associated email.

However, if I were to raise an issue using my personal email, or if someone else within a customer company were to raise a ticket through the rest api, it automatically sets it to anonymous. Here's my code, bear in mind we've done a bit of personalisation:

 

let result = await core.Jira.CreateIssue({
    "Type": "NewDomainAuth",
    "Summary": "New domain authentication",
    "Description": "",
    "ReporterEmail": emailContact
});
Like I said, this works fine, but only if the email already exists in our system. Let's say we have a Janice@helloworld.com registered, but someone else in the company e.g. Steve@helloworld.com creates a ticket and he isn't already in the system it comes in as anonymous, and hasn't linked the email to the reporter. I don't want them registered as a new user, I just want them to receive updates on the ticket.
Thoughts? Let me know if more information is required.

1 answer

0 votes
Judd Garratt - Path of Trees
Atlassian Partner
September 10, 2023

Hi Josiah!

Are you using JSM for ticketing or vanilla Jira? This can be done with JSM via api by creating a new 'customer' in the system before creating the ticket. If using vanilla Jira, the reporter field must be a registered user, so that's why you're seeing it come back as anonymous.

It sounds like JSM might but what you need. Happy to share more about how to get this working via the JSM api if that helps. I've been meaning to write up an article on how to do this.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events