How to set the reporter in create issue by API (POST REST API)

Julien Groud December 11, 2024

I try to create a issue ticket with the REST API
POST /rest/api/3/issue

In the body I set : 

"reporter":"id": '0123456789'},
But got the error : 
{"errorMessages":[],"errors":{"reporter":"Field 'reporter' cannot be set. It is not on the appropriate screen, or unknown."}}
I tried as value the accountId of the user, the emailAddress of the user and the displayName of the user but I always got the same error.

I found on internet users using 
raiseOnBehalfOf but got the same error with the same values tested on reporter
Can you help me ?

3 answers

1 accepted

0 votes
Answer accepted
Julien Groud December 17, 2024

Problem solved ! 
The account creating tickets must be admin on projet level (I was admin on organisation level).

So go to https://XXX.atlassian.net/plugins/servlet/project-config/XXX/people and add you as admin on the project.

1 vote
Nathan Phillips
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 17, 2024

Hello Atlassian Community members.

I wanted to update here. The resolution to this post was that we were missing the 'Modify Reporter' permission within the project where this issue was attempting to be created!

Giving ourselves 'Modify Reporter' permission allowed us to successfully create an issue in our project. Best of luck out there!

0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 12, 2024

Hi @Julien Groud 

Welcome to the community.

The error states that the field reporter is not on the screen that used by the issue type that you you in your API call.

Is the reporter on the field used by the issue type you want to create?

Julien Groud December 12, 2024

Hi @Marc - Devoteam 

Thanks for your quick response.

When I check on web interface I saw the field "Rapporteur" ("Reporter" in french)
On this page : https://XXX.atlassian.net/plugins/servlet/project-config/XXX/issuetypes/10009/fields
image.png

And when I create a ticket manually I have the information on the ticket
image.png

Is there a way to confirm with an API call ? 

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 12, 2024

Hi @Julien Groud 

What is the API call you are trying to make?

You can use this field, but in your API call you are specifying an issuetype in the call as well.

An issue type in Jira is related to an issue type screen scheme in a project.

On the issue type a single or multiple screen schemes can be used, based on the issue type.

Check which screen scheme is used for the issue type you want to create, in the found screen scheme, see the screen that is used to create the issue, is the field reporter on this screen?

 

Julien Groud December 12, 2024

Thanks @Marc - Devoteam 
I try to understand the link between data and make request to find the good ids.

I have GET the list of issueType /rest/api/3/issuetypescreenscheme/project?projectId=10033

I got only one : 
{
   "maxResults": 50,
   "startAt": 0,
   "total": 1,
   "isLast": true,
   "values": [
      {
         "issueTypeScreenScheme": {
            "id": "10030",
            "name": "LIB: Kanban Issue Type Screen Scheme",
            "description": "",
            "projects": {
               "maxResults": 0,
               "startAt": 0,
               "total": 0,
               "isLast": true,
               "values": []
            }
         },
         "projectIds": [
            "10033"
         ]
      }
   ]
}

After I have GET the list of issue screen scheme 
/rest/api/3/issuetypescreenscheme/mapping
{
   "issueTypeScreenSchemeId": "10006",
   "issueTypeId": "10009",
   "screenSchemeId": "10030"
}

From the issueTypeScreenSchemeId i search screenScheme /rest/api/3/screenscheme
{
   "id": "10234",
   "name": "LIB: Kanban Issue Type Scheme",
   "defaultIssueTypeId": "10006"
}

And to finish i select le available fields of the screen scheme
/rest/api/3/screens/10112/availableFields
I don't find reporter in the result. But when I am going on web on 
https://XXX.atlassian.net/secure/admin/ConfigureFieldScreen.jspa?id=10112
The field is listed on it.

How can I make it available in the API ?
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 12, 2024

Hi @Julien Groud 

Why are you trying all this from API, use the GUI.

You can't add fields to a screen via the API.

Julien Groud December 12, 2024

From the GUI, I have the field that I want

Like Marc - Devoteam likes this
Julien Groud December 12, 2024

@Marc - Devoteam Have you any other idea for me ? 

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 12, 2024

Is it on the screen, that is used when creating the issue

What is the API you code that you are making.

An example on creating an issue can be found here:

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post 

Julien Groud December 15, 2024

I just want to create a ticket with the REST API.
I used this doc and this example to do it.
And in the example there is 
"reporter": { "id": "5b10a2844c20165700ede21g" }
But when i set it it doesn't work.

Nathan Phillips
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 17, 2024

Hello @Julien Groud,

Thank you for reaching out on the Atlassian Community.

In the example REST API example you are referring to, the reporter field provides an example Atlassian Account ID:

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

In order for the reporter to be set during issue creation using this field, you will need to know the Atlassian Account ID of the User you would like to make the reporter, then replace that user's ID in your REST API call.

To get your personal Atlassian Account ID. Navigate back to your Jira site, then select your avatar in the top right corner, then select Profile.

Here, review the URL which is loaded for this page, and you will see your unique Atlassian Account ID at the end of the URL.

Julien Groud December 17, 2024

Hi @Nathan Phillips 
Yes It is what i am doing.
Here is my request

curl --request POST --url 'https://XXX.atlassian.net/rest/api/3/issue' --user XXX --header 'Accept: application/json' --header 'Content-Type: application/json' --data '{"fields":{"customfield_10102":{"id":"10276"},"description":{"content":[{"content":[{"text":"12345","type":"text"}],"type":"paragraph"}],"type":"doc","version":1},"issuetype":{"id":"10009"},"priority":{"id":"1"},"project":{"id":"10033"},"reporter":{"id":"MY_ID"},"summary":"Test"}}'
I checked the id and its the same of my profile page on the interface
https://XXX.atlassian.net/jira/people/MY_ID

But i continue to get this error : 
{"errorMessages":[],"errors":{"reporter":"Field 'reporter' cannot be set. It is not on the appropriate screen, or unknown."}}

Nathan Phillips
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 17, 2024

Hello @Julien Groud,

I think that it might be best if you connected with our Technical Support team to better assist you with this error.

I went ahead and created a ticket on your behalf, and we will contact you shortly to further investigate!

Julien Groud December 17, 2024

Problem solved ! 
The account creating tickets must be admin on projet level (I was admin on organisation level).

So go to https://XXX.atlassian.net/plugins/servlet/project-config/XXX/people and add you as admin on the project.

Suggest an answer

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

Atlassian Community Events