0

I am using Jira library with Python to create Jira-issue but getting below error:

jira.exceptions.JIRAError: JiraError HTTP 400

text: Field 'Component/s' cannot be set. It is not on the appropriate screen, or unknown.

url: http://jira.corp.inmobi.com/rest/api/2/issue

response headers = {'X-AUSERNAME': 'noc', 'X-ASEN': 'SEN-2505611', 'X-Content-Type-Options': 'nosniff', 'Content-Encoding': 'gzip', 'Transfer-Encoding': 'chunked', 'X-Seraph-LoginReason': 'OK', 'Vary': 'User-Agent', 'X-AREQUESTID': '125x24693491x2', 'X-ASESSIONID': '1tjvpeo', 'Connection': 'close', 'Cache-Control': 'no-cache, no-store, no-transform', 'Date': 'Sun, 29 May 2016 02:05:05 GMT', 'Server': 'Apache-Coyote/1.1', 'Content-Type': 'application/json;charset=UTF-8'}

response text = {"errorMessages":[],"errors":{"Component/s":"Field 'Component/s' cannot be set. It is not on the appropriate screen, or unknown."}}

Could anyone please help me to sort out it?

Community
  • 1
  • 1
  • Can you post the JSON you are sending? – EngineerCamp May 29 '16 at 03:59
  • from jira.client import JIRA import cgi, cgitb options={'server': 'http://jira.server.com'} jira=JIRA(options,basic_auth=('username', 'Password')) root_dict = { 'project' : { 'key': 'ABC' }, 'summary' : 'Test', 'description' : 'Ignore this. will be deleted shortly', 'issuetype' : { 'name' : 'Task' }, 'Component/s': [{'name' : "ABC"}], } my_issue= jira.create_issue(fields=root_dict) – vivek sinha May 29 '16 at 05:35

1 Answers1

1

Jira is complaining about the unexpected backslash in 'Component\s'.

Change it to:

'components: [{'name' : "ABC"}]'

and it should solve your issue (pun intended).

EngineerCamp
  • 661
  • 1
  • 6
  • 16