I'm trying to create an issue of type "Bug" with custom field called "customfield_10040"

Saranraj Gandhi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 8, 2023

I'm trying to create an issue of type "Bug" with a custom field called "customfield_10040" but I'm getting an error 

error message: {"errorMessages":[],"errors":{"customfield_10040":"Specify a valid 'id' or 'name' for Severity"}

 

Here is a code which I tried:

fields = {
"project": project_name,
"issuetype": issue_type,
"customfield_10040": [{"id":11938}],
"priority": priority_type,
"summary": summary,
"description": description,
}
print(fields)
new_issue = jira.create_issue(fields=fields)
while looking into the previously created issues via Jira UI my custom field values are looks like the below,
"customfield_10040": {
"value": "Severity-2",
"id": "11938"
}
But I'm getting the same error while using the correct id as mentioned in the customfield_10040.

1 answer

1 accepted

0 votes
Answer accepted
Tansu Akdeniz
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 8, 2023

Hi @Saranraj Gandhi 

Welcome to the community.

Can you try this format?

  • "customfield_10040": {"id": "11938"},
Saranraj Gandhi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 8, 2023

After trying with the above format I'm getting this error, @Tansu Akdeniz kindly help me to resolve this.

 

{"errorMessages":["I-nautix environment Affected, Severity are marked as mandatory fields."],"errors":{}}

 

fields = {
"project": project_name,
"issuetype": issue_type,
"customfield_10040":{"id":"11938"},
"priority": priority_type,
"summary": summary,
"description": description,
}
print(fields)
new_issue = jira.create_issue(fields=fields)
Tansu Akdeniz
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 8, 2023

Since there are other fields required in fields, you have to send that information too in order to create an issue.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events