Skip to content

saimon-moore/jira-tools-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automate creating tedious jira tickets

JIRABOT

Jirabot helps you scaffold out long lists of tickets with some AI magic to help you along...

Setup

  1. Install ollama

  2. Install the python dependencies with pip install -r requirements.txt

  3. Define a Jira API key for your user here

  4. Install 1password cli (optional) brew install 1password-cli

  5. Create a new login with username = YOUR_EMAIL & password = JIRA_API_KEY

  6. Look up jira ids you need to define the jira project's config

    e.g. Find your jira project's id using: curl -u [email protected]:{API_KEY} -X GET -H "Accept: application/json" "https://new-work.atlassian.net/rest/api/3/project"

    e.g. Find your project's issue types using: curl -u [email protected]:{API_KEY} -X GET -H "Accept: application/json" "https://new-work.atlassian.net/rest/api/3/issue/createmeta?projectKeys={PROJECT_KEY: e.g. XJM}"

    e.g Find the investment profile custom field id using: curl -u [email protected]:{API_KEY} -X GET -H "Accept: application/json" "https://new-work.atlassian.net/rest/api/3/field"

    e.g. Find the investment profile custom field possible values using: curl -u [email protected]:{API_KEY} -X GET -H "Accept: application/json" "https://new-work.atlassian.net/rest/api/3/field/customfield_10089/context" (Apparently only jira admins can do this so talk to them or use the network panel when creating a task to look for a request like: /rest/gira/1/?operation=JiraGlobalIssueCreateModalLoad)

  7. Define project config json files under the config/ folder using this json structure:

e.g. config/XJM.json // {PROJECT_KEY}.json

{
    "projectKey": "XJM",
    "projectId": 10154,
    "issueTypes": [
        "Bug": 10014,
        "Epic": 10000,
        "Investigation": 10019,
        "Task": 10015,
        "Technical Debt": 10040,
        "Training": 10038,
        "User Story": 10004
    ],
    "investmentProfiles": [
        "NONE": "",
        "NEW_OR_IMPROVED_FUNCTIONALITY": "New or improved Functionality",
        "NEW_OR_ADDITIONAL_REVENUE": "New or additional Revenue",
        "TECH_DEBT": "Tech Debt",
        "OPERATIONS_AND_SUSTAINABILITY": "Operations & Sustainability",
        "EXTERNAL_REQUEST_OR_CITIZENSHIP": "External Request / Citizenship",
        "BUG_OR_DEFECT": "Bug or Defect",
        "OTHER": "Other",
    ],
},

At this point, the initial setup is done for a particular project.

  1. Now, just create a csv file under ./projects/{PROJECT_KEY}.csv with a description of all the tickets you want to create that looks like this:
issueType,title,parent,investmentProfile,duedate,labels
Task,Create reusable nextjs kafka module for BCL,XJM-2939,New or improved Functionality,,
Investigation,[Spike] Investigate how to create OpenSearch index,XJM-2939,New or improved Functionality,,
  1. Run the script 🦙 It will ask you for which project do you want to create issues and then read the issues specified in the corresponding CSV files.

Note: The templates used to generate the description are hard coded. Feel free to fork and change them or enhance the code to read the templates from a project specific folder.

Just keep editing the CSV file and rerunning the script...

About

Jira tools (in python)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages