I’m trying to figure out if there’s a way to get a JIRA plan as a CSV file using Python. I know I can do this manually in JIRA by clicking the export button when I’m looking at a plan. But I can’t seem to find anything in the Python API docs about working with plans or exporting them.
Has anyone done this before? Is it even possible with the API? I’ve gone through the documentation but there’s no mention of plans or exporting them that I could find.
While the JIRA API doesn’t offer a direct method to download plans as CSV, a viable workaround is to fetch the issues associated with your plan and then process the data into a CSV file. You could query for the issues using JQL and extract the necessary fields before writing the information to a file with Python’s csv module. Although this method involves more coding than a simple export function, it provides greater flexibility in selecting and formatting the data. Even if it may not capture every aspect of a JIRA plan, it offers a solid starting point.
I’ve actually encountered a similar challenge when working with JIRA’s API. While the Python JIRA library doesn’t have a direct method for exporting plans as CSV, I found a workaround that might help.
Instead of trying to export the plan directly, I queried for the issues in the plan using JQL (JIRA Query Language) and then constructed the CSV myself. It takes a bit more coding, but it’s quite flexible.
First, you’ll need to use the JIRA API to fetch the issues. Then, you can use Python’s csv module to write the data to a file. You’ll have to decide which fields you want to include, but this approach gives you full control over the output.
It’s not as straightforward as clicking an export button, but once you have the script set up, you can automate the process and even schedule regular exports if needed. Hope this gives you a starting point!
i’ve used the api b4. there’s no direct csv export, but you can grab the plan issues with search_issues() and then pipe them to python’s csv module. it’s a bit manual, but gives control over data selection. hope it helps!