0

I am trying to integrate Jira with Python using Rest API.

I am using the below mentioned code to create an issue in JIRA using Python. However I am encountering an error mentioned below.

from jira import JIRA

jira = JIRA(basic_auth=('Username,'API Token'), options={"server": "https://ProjectName.atlassian.net/"})

options={"server": "https://ProjectName.atlassian.net/"}

jira=JIRA(options)

test_case_data= {
    "project": {"id": "10000"},
    "summary": "test summary",
    "description": "test description",
    "issuetype": {'name': 'Task'},
}

jira.create_issue(fields=test_case_data)

Below is the error I am getting:

JIRAError: JiraError HTTP 400 url: https://ProjectName.atlassian.net/rest/api/2/issue text: Field 'summary' cannot be set. It is not on the appropriate screen, or unknown., Field 'description' cannot be set. It is not on the appropriate screen, or unknown.enter image description here

1
  • There's an extra comma after the last key, but this doesn't seem to be the real problem (rather a copy&paste&delete artefact). Commented Dec 15, 2020 at 15:49

3 Answers 3

0

Was facing a similar issue today. Try using the full email address associated with the account as the username.

Sign up to request clarification or add additional context in comments.

Comments

0

Are you able to create a Jira issue with the same account and with the exactly same input data? Is summary field really available?

Checkout Atlassian REST API documentation - they described various cases when server might return error 400. They also use REST API v3, you use v2 (but this shouldn't be a problem).

Comments

0

In my Case it helps to make a request only with the type. I see that there are new Types created for the Project. You can found them by get api/projectTypes. Try to let your other fields empty and then you got the message type is invalid. Found the issuetypes for project and use that as id.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.