I met issue when I call create issue api in my code, the error 'It is not on the appropriate screen, or unknown.' But when test api with the same parameters in postman, it is succeed, so I don't think is the field doesn't add to screen causes the error, do you know the reason?
This is my code:
create_url = "https://myjira/rest/api/2/issue/"
jira_hash =
{
"fields": {
"project": {
"id": "51606"
},
"issuetype": {
"name": "SOAK EVENT"
},
"priority": {
"name": "Critical"
},
"labels": ["Chandler"],
"customfield_10012": {
"id": "10006"
},
"fixVersions": [{
"name": "2019-05-r1"
}],
"summary": "10297",
"description": "description"
}
}
HTTParty.post(create_url,
:body => jira_hash.to_json,
:headers => {'Content-Type' => 'application/json', 'Authorization' => auth})
Hi @yaogang xu ,
Could You please check that auth are the same in both. Can You see in server side how looks request from postman and code?
B.R.
@Andrew In postman, I set authorization as Basic Auth type and pass my jira account and password, in my code, my account and pwd are encrypted by base64encode. These two way are the same, right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Should be. I think better try see on server side different between requests.
Are You sure the method is post? In groovy I add :
connection.setRequestMethod("POST")
B.R.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found the auth issue caused this problem. I passed username and password without encrypted and it was succeed.
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.