Cant add issues for epic with API

Viacheslav Andriichuk November 14, 2018

Hi, I try "next-gen project", when I create main "Epic" and other "Tasks" I try to add all list of keys (Tasks) for created "Epic".

issue_oiptions_for_add_task = {
'project': {'key': self.project_key},
'summary': self.config['Epic']['summary'],
'description': self.config['Epic']['description'],
'issuetype': {'name': 'Epic'}
}

new_issue = self.jira.create_issue(fields=issue_oiptions_for_add_task)
self.epic_id = new_issue.id
issue_oiptions_for_add_task = {
'project': {'key': self.project_key},
'summary': task['summary'],
'description': task['description'],
'issuetype': {'name': 'Task'}
}
new_issue = self.jira.create_issue(fields=issue_oiptions_for_add_task)
self.issue_keys.append(new_issue.key) 

and after that:

self.jira.add_issues_to_epic(epic_id=self.epic_id, issue_keys=self.issue_keys)

output:
response text = {"errorMessages":["gh.epic.error.not.found"],"errors":{}}

1 answer

0 votes
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 12, 2019

Hi! 

Have you fixed that error? 

Viacheslav Andriichuk April 13, 2019

Unfortunately no

Viacheslav Andriichuk December 1, 2020

solved this issue with update created tickets one by one

new_issue.update(fields={
'parent': {'id': self.epic_id}
})
Like Gonchik Tsymzhitov likes this
Illia Sukonnik December 2, 2021

j.create_issue(
project='YOUR_PROJECT',
parent={'id':self.epic.id},
...

)

Suggest an answer

Log in or Sign up to answer