Forums

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

What are the API payload fields or a sample issue creation payload that will include the author name

ALL IT ONE January 31, 2024
We are unable to get their field names from the API documentation.
I was trying to create an issue via API endpoint using the below payload, but the Author name and e-mail address fields are not being populated on the issue dashboard, what can I do ?
{
"fields": {
"project": {
"key": "DEMO"
},
"creator": {
"name": "name",
"emailAddress": "email",
"displayName": "name"
},
"issuetype": {
"id": "10004"
},
"summary": "title",
"description": "description",
"customfield_10032": [
{
"add": [
{"name": "name"},
{"email": "email"}
]
}
],
"priority": {
"id": "priority"
}
},
"user": {
"name": "name",
"emailAddress": "email",
"displayName": "name"
}
}
Can anybody help me?

1 answer

0 votes
Hana Kučerová
Community Champion
January 31, 2024

Hi @ALL IT ONE ,

welcome to the Atlassian community!

Please, which API endpoint are you using? Are you trying to create a request on behalf of your customer? If yes, please see here 

In general you need to provide accountId of your user (not name and user). 

ALL IT ONE February 1, 2024

@Hana Kučerová Thank you 

 

Here is the endpoint I am trying to use: /rest/api/2/issue/
It is meant to create a new issue for a project.

Despite the fact that we are submitting the creator details in the payload, the issue author remains anonymous on our Atlassian dashboard. Likewise the author's e-mail address too.

This is the part we want you to help us address. Or must users be registered on Atlassian an have accountIds before they can be able to submit an issue?

 

ALL IT ONE February 2, 2024

@Hana Kučerová can you help us?

Hana Kučerová
Community Champion
February 2, 2024

Hi @ALL IT ONE ,

in cloud the user needs to have Atlassian account created. Each account has unique id (=accountId), which you need to provide.

Please see here - in the sample body data there's:

 "reporter": { "id": "5b10a2844c20165700ede21g" }

This id means accountId.

ALL IT ONE February 5, 2024

@Hana Kučerová 
Thank you for this. Does that mean a user must be created every time a new client reports an issue?

Hana Kučerová
Community Champion
February 5, 2024

@ALL IT ONE I still don’t understand much your usecase. To which type of Jira project are you trying to create an issue? Is it Jira Software or Jira Service Management?

You are saying your clients are creating an issue. Why are you doing this using REST API? Are these clients users of your Jira and have product license or are they customers in your portal?

ALL IT ONE February 6, 2024

@Hana Kučerová 

We use Jira Service Management. A problem is reported on a website using a form (all visitors can do this) and a ticket is created from this via an API in Jira. The users are therefore not registered in Jira and do not have a Jira license. That wouldn't make any sense from a price point of view. You can understand it as a kind of helpdesk... the ticket is then processed internally via Jira. That's why we, as the author of the ticket, would like to provide the name specified on the form.

Hana Kučerová
Community Champion
February 6, 2024

Thanks @ALL IT ONE . In that case I believe you have two options:

  1. As a reporter use one of your users with JSM licence and create custom fields to store information about your customers (for example one for the customer name and one for the customer e-mail).
  2. Create customer account in JSM project (see here) and use the accountId for the reporter. This way your customers will be able to login to your portal later and communicate further with you about the request. Also your customers don't need any license, you can have as many customers as you like for free. You only pay for JSM agents.
ALL IT ONE February 25, 2024

Hi, 
I got this error while trying to add the reporter field

Error message:
{"errorMessages":[],"errors":{"reporter":"Field 'reporter' cannot be set. It is not on the appropriate screen, or unknown."}}

Part of the payload used:

"fields" => [
                "reporter" => [
                    "accountId" => "62bd712ffbc1f7c647b92fb4",
                    "name" => "ALL IT ONE",
                    "emailAddress" => "admin@all-it-one.ch",
                    "active" => true
                ],
                "project" => [
Hana Kučerová
Community Champion
February 25, 2024

Hi @ALL IT ONE ,

please check the screen for a create operation in your project.

Is reporter field on this create screen?

ALL IT ONE February 26, 2024

@Hana Kučerová Please how do I do that?

 

Hana Kučerová
Community Champion
February 29, 2024

Hi @ALL IT ONE ,

please navigate to your project settings > left menu - Screens > here you need to find screen scheme for the issue type, you are creating. In the detail of the screen scheme you should see screens for three operations, open the one for create issue. Check, if reporter is available in the list of fields.

 

ALL IT ONE March 20, 2024

@Hana Kučerová Thank you.

I checked and there was no such field named reporter. I tried to create one as a custom field but it is still did not work.

Hana Kučerová
Community Champion
March 20, 2024

@ALL IT ONE You need to add system field Reporter to the screen.

Newly created custom field Reporter won’t work and it will be confussing for your users. I suggest delete the custom field again.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events