Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,256,582
Community Members
 
Community Events
164
Community Groups

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

Edited

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

4 votes
Answer accepted

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
}
};

That works, thank you for the help

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.

Can you set the reporter email as well?

Like # people like this

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

Safe customer notifications in Jira Service Management for compliance and privacy needs

Announcing safe customer notifications in Jira Service Management as a building block for compliance and privacy needs At Atlassian, we understand the increasing need to be assured that your data i...

307 views 1 14
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you