How to remove epic link in python? Edited

I am trying to use the Jira Python API to automatically add and remove issues. When adding, I was able to assign the epic link field (customfield_1006) to the name of an existing epic link, but when I try to remove the epic link by assigning it to an empty string, Jira throws an internal server error. I can remove the epic link through my browser, but I can't automate it through Python. Is there any way to remove an issue from an epic link using the API?

1 answer

1 accepted

0 votes
Accepted answer

I wasn't able to remove an epic link from an issue with the existing JIRA Python library. I was able to write this definition and add it to the file to add this functionality.
I added this to

 def remove_from_epic(self, issue_keys): 
if self._options['agile_rest_path'] != GreenHopperResource.GREENHOPPER_REST_PATH:
raise NotImplementedError('JIRA Agile Public API does not support this request')

data = {}
data['issueKeys'] = issue_keys
url = self._get_url('epics/remove', base=self.AGILE_BASE_URL)
return self._session.put(
url, data=json.dumps(data))

You can then remove the epic link from an issue in your code with the line below.  



I created a pull request to add this code to the repo so hopefully it will be integrated into a future release. 

Hi Shaun,

Thank you so much for implementing this fix! Will it be available in a library I can import soon? If I need to copy the script you wrote into my code instead, is there a library I need to import in order to make this function (besides JIRA)? 

Shaun Seaver Atlassian Team Aug 01, 2017



No problem! I added the remove_from_epic definition to the file for jira-python.  For me this path is 


Depending on what OS and version of Python you're using, this path may be different. As far as when it will be available I'm not sure. I submitted a pull request yesterday, and the code is still under review. You can view the progress here. I forgot to mention that this also accepts multiple issue-keys to remove the epic link from. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,088 views 4 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you