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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Create an issue with rest api set reporter name

Hi community, im trying to create an issue with rest api, im receving error 400 (bad request)

the problem is when i try to set another reporter. I have seen that you can add a reporter name, but it doesnt work for me. If i remove the section of reporter it works fine, but i need to change the reporter.

this is my code

fields: {
project: {
id: "10000"
},

reporter: {

name: "mcosta"
},
summary: "testAccJira",
description: "descripcion del issue ",
issuetype: {
id: "10001"
}
}
}

 

the e-mail that im registered is mcosta@....com.uy

my name is Matias Costa Meneses

I had trying putting my name, my mail, the left part of my email, and nothing work...  what is the username? where i get it?

 

thanks!!

2 answers

1 accepted

0 votes
Answer accepted

Hi @Matias Costa Meneses,

based on your information, you mentioned that you're using a Cloud instance.

Atlassian has disabled user names on Cloud instances, therefore you're not able anymore to set a reporter via a name. You should use an accountId instead. The accountId is the unique identifier of your Atlassian account. In order to find it out, you can e.g. call this url https://YOURINSTANCE.atlassian.net/rest/api/2/myself (while you're logged in to your Atlassian account). The response will look like this:

{
"self": "https://YOURINSTANCE.atlassian.net/rest/api/2/user?accountId=1234567890",
"accountId": "1234567890",
...
}

Using this accountId, you should be able to create your issue with such a request:

{ 
fields: {
  project: {
    id: "10000"
},
reporter: {
accountId: "1234567890"
},
summary: "testAccJira",
description: "descripcion del issue ",
issuetype: {
id: "10001"
}
}
}

Hope that helped!

Cheers,
Matthias

Thank you very much for the answer, could you tell me if there is any way to change the reporter using the email address?

You can do another rest call before which resolves the accountId via the email address. I'd recommend using the "find users by query" REST API for it. As query parameter, you can specify your email address.

From the response, you should be able to parse the accountID

Like Matias Costa Meneses likes this

thanks a lot Matthias!!

Hi Matthias, i was trying putting de accountId but it doesnt work.. i receive the same error, 400 bad request.  

im sending in this format

{ 
fields: {
  project: {
    id: "10000"
},
reporter: {
accountId: "The_accountId_of_the_user"
},
summary: "testAccJira",
description: "descripcion del issue ",
issuetype: {
id: "10001"
}
}
}


 

Could you tell me if there is something else that i should do? did it work for you?

I tried it basically with the same request - and it worked. Does the error tell you more what is wrong? Maybe an invalid accountId?

Here's my request:

{
"fields": {
"summary": "create test",
"project": { "key": "CA" },
"reporter": { "accountId": "The_accountId_of_the_user" },
"issuetype": { "name": "Task" }
}
} 

Hello Matthias! thanks for help me! Yes, now it is working, but I think that day they were making a change or modifying something, because I did not change anything and the next day it started working

Advanced issue search -> enter JQL reporter = your_name

In the parentheses you will see the username 

Suggest an answer

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

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