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!!
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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" }
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Advanced issue search -> enter JQL reporter = your_name
In the parentheses you will see the username
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.