Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Met error 'It is not on the appropriate screen, or unknown' when calling create issue api

yaogang xu
Contributor
April 30, 2019

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

 

1 answer

0 votes
Andrew
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.
April 30, 2019

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.

yaogang xu
Contributor
April 30, 2019

@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?

Andrew
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.
April 30, 2019

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.

yaogang xu
Contributor
April 30, 2019

I found the auth issue caused this problem. I passed username and password without encrypted and it was succeed. 

Like Andrew likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events