Forums

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

Can not create Epic type of task via API

Aleksandar Colic January 21, 2022

Hi,

 

When I create the "Task" type, all tasks were created successfully. 

However, when I try to create "Epic", I am getting the following error:

....

File "/usr/local/lib/python3.8/dist-packages/jira/resilientsession.py", line 64, in raise_on_error
raise JIRAError(
jira.exceptions.JIRAError: JiraError HTTP 400 url: https://spothopper.atlassian.net/rest/api/2/issue
text: Epic Name is required.

......

Expect-CT': 'report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/global-proxy", enforce, max-age=86400'}
response text = {"errorMessages":[],"errors":{"customfield_10011":"Epic Name is required."}}

 

This is a code that is creating issues:

....

project = "WEB"

#issuetype = "Task"
issuetype = "Epic"

for issue in issues:
    jira.create_issue(project=project, summary=issue.title, description=issue.html_url, issuetype=issuetype)

....

 

Regards,

Aleksandar

 

2 answers

1 accepted

0 votes
Answer accepted
Mikael Sandberg
Community Champion
January 21, 2022

As the error message indicates, when you create an Epic both summary and epic name are required fields. Based on your code you are not setting the epic name and that is why you get the error.

0 votes
Aleksandar Colic January 24, 2022

There was no Epic Name field. The solution is this:

jira.create_issue(project=project, summary=issue.title, customfield_10011=issue.title, description=issue.html_url, issuetype=issuetype)

 

Cheers,

Aleksandar

Suggest an answer

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

Atlassian Community Events