DEV Community

Orbit Websites
Orbit Websites

Posted on

Is Software Development Just a Side Quest? A Jira Story

Is Software Development Just a Side Quest? A Jira Story

You’re not alone if you’ve ever felt like software development is just a side quest in a chaotic RPG where the real mission is surviving Jira tickets, standups, and sprint deadlines. But what if we told you you can turn Jira from a villain into a sidekick?

In this beginner-friendly, code-heavy tutorial, we’ll walk through how to automate Jira ticket creation using Python — turning repetitive tasks into a superpower. By the end, you’ll have a script that auto-generates tickets for common development tasks, so you can focus on the real quest: building cool stuff.


🛠️ What You’ll Need

  • Python 3.6+
  • A Jira Cloud account (free tier works)
  • pip install jira
pip install jira
Enter fullscreen mode Exit fullscreen mode

💡 Don’t have Jira? Sign up at https://www.atlassian.com/software/jira/free


🔑 Step 1: Get Your Jira API Credentials

Jira uses API tokens for authentication (not your password).

  1. Go to: https://id.atlassian.com/manage-profile/security/api-tokens
  2. Click Create API token
  3. Name it (e.g., jira-bot)
  4. Copy the generated token

Store your credentials in a .env file (never commit this!):

JIRA_SERVER=https://your-domain.atlassian.net
JIRA_EMAIL=your-email@example.com
JIRA_TOKEN=your-api-token-here
JIRA_PROJECT_KEY=PROJ
Enter fullscreen mode Exit fullscreen mode

Replace your-domain, your-email, and PROJ with your actual Jira domain, email, and project key.


🐍 Step 2: Set Up Your Python Script

Create a file called jira_quest.py:

import os
from jira import JIRA
from dotenv import load_dotenv

# Load environment variables
load_dotenv()

# Connect to Jira
jira = JIRA(
    server=os.getenv("JIRA_SERVER"),
    basic_auth=(os.getenv("JIRA_EMAIL"), os.getenv("JIRA_TOKEN"))
)

print("✅ Connected to Jira!")
Enter fullscreen mode Exit fullscreen mode

Test it:

python jira_quest.py
Enter fullscreen mode Exit fullscreen mode

If you see ✅ Connected to Jira!, you’re in.


🧙 Step 3: Create a "Side Quest" Ticket Automatically

Let’s say every time you start a new feature, you need to create:

  • A "Development" task
  • A "Code Review" subtask
  • A "Testing" subtask

We’ll automate that.

Update jira_quest.py:

def create_feature_quest(feature_name: str):
    # Main task
    main_task = jira.create_issue(
        project=os.getenv("JIRA_PROJECT_KEY"),
        summary=f"[DEV] Build feature: {feature_name}",
        issuetype={"name": "Task"},
        description="Auto-generated development task."
    )
    print(f"🔥 Created main task: {main_task.key}")

    # Subtask: Code Review
    jira.create_issue(
        project=os.getenv("JIRA_PROJECT_KEY"),
        summary=f"[REVIEW] Review code for {feature_name}",
        issuetype={"name": "Sub-task"},
        parent={"key": main_task.key},
        description="Peer review needed before merge."
    )
    print("📝 Created code review subtask")

    # Subtask: Testing
    jira.create_issue(
        project=os.getenv("JIRA_PROJECT_KEY"),
        summary=f"[TEST] Test {feature_name} in staging",
        issuetype={"name": "Sub-task"},
        parent={"key": main_task.key},
        description="Verify functionality and edge cases."
    )
    print("🧪 Created testing subtask")

    print(f"\n🎉 Side quest launched: {main_task.key}")
Enter fullscreen mode Exit fullscreen mode

Now call it:

if __name__ == "__main__":
    create_feature_quest("User Profile Page")
Enter fullscreen mode Exit fullscreen mode

Run it:

python jira_quest.py
Enter fullscreen mode Exit fullscreen mode

Check your Jira project — you should see a new task with two subtasks!


🔄 Step 4: Turn It Into a CLI Tool

Let’s make it interactive. Install fire for CLI magic:

pip install fire
Enter fullscreen mode Exit fullscreen mode

Update your script:

import fire

if __name__ == "__main__":
    fire.Fire(create_feature_quest)
Enter fullscreen mode Exit fullscreen mode

Now run from terminal:

python jira_quest.py "Dark Mode Toggle"
Enter fullscreen mode Exit fullscreen mode

Output:

🔥 Created main task: PROJ-45
📝 Created code review subtask
🧪 Created testing subtask

🎉 Side quest launched: PROJ-45
Enter fullscreen mode Exit fullscreen mode

Boom. One command, three tickets. You just saved 5 minutes per feature.


🧰 Bonus: Add Labels and Assignees

Make tickets more actionable by assigning them and adding labels.

Update the main task creation:

main_task = jira.create_issue(
    project=os.getenv("JIRA_PROJECT_KEY"),
    summary=f"[DEV] Build feature: {feature_name}",
    issuetype={"name": "Task"},
    description="Auto-generated development task.",
    labels=["automation", "frontend"],
    assignee={"accountId": "your-account-id"}  # Optional
)
Enter fullscreen mode Exit fullscreen mode

🔍 Find your Account ID at: [https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#account-id](https://developer.atlassian.com/cloud/jira/platform


Community-Focused

Top comments (0)