As a project manager or a software engineer, you will be required to create an epic on Jira to track work.
Jira is one of the most important tools to get the job done.
Jira, as a platform, allows you to:
- Track your team’s work.
- Manage the scope of incoming, ongoing and done work.
- Assign tasks to the relevant team members.
- Monitor task progress.
Python can be leveraged to create an epic on Jira.
Using Python is a great way to automate some of the more tedious tasks associated with project management, and save you a lot of time in the long run.
Here is how to create an epic with Python on Jira:
- Install the Jira Python library by running the following command:
pip install jira
2. Import the Jira library and create a Jira client object. This will allow you to interact with the Jira instance using Python code.
from jira import JIRA
jira_connection = JIRA(
basic_auth=('<workspace_email>', '<api_token>'),
server="https://<server_name>.atlassian.net"
)
3. Next, create an epic ticket using the following code snippet.
# Create a new epic with the given name and description
ticket_options = {
'project': {'key': 'PJH'},
'summary': 'Testing epic from Python Jira Handbook',
'description': 'This epic was created using the Python Jira Handbook',
'issuetype': {'name': 'Epic'},
'customfield_10011': 'Testing epic from Python Jira Handbook'
}
epic = jira_connection.create_issue(fields=ticket_options)
Note: customfield_10011 is required when creating Epics only, the custom field is used to pass the Epic Name value. Read more.
See more information on how to create a Jira issue with Python.
4. Add issues to the newly created epic by using the add_issues_to_epic()
method. The method takes a list of issue keys as an argument and adds them to the epic.
# Add the specified issues to the epic
jira_connection.add_issues_to_epic(epic_id=epic.id, issue_keys=["PJH-1"])
With a few lines of Python code, you can easily create epics and add issues to them on Jira.

Complete code snippet:
from jira import JIRA
jira_connection = JIRA(
basic_auth=('<workspace_email>', '<api_token>'),
server="https://<server_name>.atlassian.net"
)
# Create a new epic with the given name and description
ticket_options = {
'project': {'key': 'PJH'},
'summary': 'Testing epic from Python Jira Handbook',
'description': 'This epic was created using the Python Jira Handbook',
'issuetype': {'name': 'Epic'},
'customfield_10011': 'Testing epic from Python Jira Handbook'
}
epic = jira_connection.create_issue(fields=ticket_options)
# Add the specified issues to the epic
jira_connection.add_issues_to_epic(epic_id=epic.id, issue_keys=["PJH-1"])
This is a great way to automate some of your project management tasks and save you time in the long run.
In conclusion, creating an epic in Jira can help you organize and execute large, complex projects.
By following the steps outlined above, you can easily create an epic. By using epics, you can break down your project into smaller, more manageable pieces and make it easier for your team to collaborate and stay on track. With the help of Jira’s effective tools and features, you can create epic stories and tasks that help you deliver high-quality products on time and within budget.
Happy coding!