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?

2
  • Can you post the JSON you are sending? Commented May 29, 2016 at 3:59
  • from jira.client import JIRA import cgi, cgitb options={'server': '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) Commented May 29, 2016 at 5:35

1 Answer 1

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

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

2 Comments

Thanks Bro..it resolved...But am still surprised as I tried the same one but it was not working ..Now it worked...Thanks a lot ..:)
@viveksinha no worries, feel free to accept my answer if it was the solution.

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.