Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I set the reporter for an issue through the rest api?

Alex Dahl June 22, 2018

I am trying to use the Jira rest API to make an issue request from our website. I have successfully made a post request that makes a ticket, but I can not figure out how to set the reporter to a specific customer. 

What I am doing is I use the API to make a post request to make a user, if one already exists the API lets me know, and I continue on to step two which is making the issue request. 

The issue request works except for this one error: reporter:"The reporter specified is not a user."

 

The Data Object I am using


let
apiPostData = {
"fields": {
"project": {
"id": "10000"
},
"summary": title,
"issuetype": {
"id": issueType
},
"priority": {
"id": "3"
},
"reporter": {
"name": "testUser", // test data
"email": "testUser@test.com" // test data
},
"description": description,
// customfield_10050 = client
// customfield_10051 = project
// customfield_10052 = langPair
// customfield_10053 = file
// customfield_10054 = where
// customfield_10055 = who
}
};

Thank you in advance 

1 answer

1 accepted

5 votes
Answer accepted
Alexey Matveev
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.
June 22, 2018

Hello,

It should be like this:

let apiPostData = {
"fields": {
"project": {
"id": "10000"
},
"summary": title,
"issuetype": {
"id": issueType
},
"priority": {
"id": "3"
},
"reporter": {
"name": "testUser"
},
"description": description
// customfield_10050 = client
// customfield_10051 = project
// customfield_10052 = langPair
// customfield_10053 = file
// customfield_10054 = where
// customfield_10055 = who
}
};
Alex Dahl June 25, 2018

That works, thank you for the help

Alexey Matveev
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.
June 25, 2018

If my answer helped you , kindly accept my answer. In this case other users with a similar question will be able to find this answer.

Joshua Chauvin April 21, 2020

Can you set the reporter email as well?

Like # people like this
Stuart__ March 2, 2021

The user should have an email address associated in user management. No need to set it here.

Benjamin Paz January 22, 2022

.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events