The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Gonchik Tsymzhitov
Community Champion
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
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!
December 2, 2021

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

)