Is there a way to import Jira issues to GitHub? - github

I've tried exporting issues from both GitHub and Jira to CSV files, but I've never tried exporting Jira issue then importing it to GitHub, is this possible? If so, what would be the best way to approach something like this?

There is simply not a "Import issues from JIRA" feature in GitHub.
The way I see it you have two options, either to integrate your current JIRA instance with GitHub or migrate the JIRA issues into GitHub issues using your own criteria and migration script.
GitHub and JIRA Integration
I would very much like to add all the instructions here but it's one of those cases where a link to the documentation makes much more sense.
There's also a video on youtube which is quite short and easy to follow.
Migrating JIRA issues into GitHub Issues
In order to do this you would have to write your own script that reads issues from the JIRA REST API and creates new ones using GitHub Issues REST API.
Note that JIRA and GitHub issues are different in nature, so your script would have to choose how to migrate one type of issue to another.
I hope this helps.

Another way is to export the JIRA issues as XML file.
The following project provides Python 2 scripts to import such a file into a GitHub project via its REST API:
https://github.com/hbrands/jira-issues-importer
Besides issues with comments, it imports milestones, labels and components as labels. References to issues in comments are to some degree converted. Also, JIRA relationships like "blocks" and "depends on" are migrated to special issue comments in GitHub.
It avoids the problem of running into abuse rate limits by using a special Issue Import API.
Please read the sections about the features, caveats, assumptions and prerequisites on the project site. Be sure to test the issue migration with a GitHub test project first.

Here are the things you need to do for export from JIRA and import to GitHub.
First export issues (to a csv file) from JIRA with the feilds you need.
Then read the csv file line by line and use the github api to create issue in GH.
https://github.com/susinda/github-client/blob/master/src/main/java/org/wso2/git/client/GitRestApiExecutor.java
Here is a sample client to do the job[1], readme contains the steps,feel free to modify it and use if that does not match with your requirement https://github.com/susinda/github-client

Try this node module https://github.com/gavinr/github-csv-tools, need to download issue form Jira and use this to upload on GitHub.

https://github.com/parcelLab/jira-to-github is a (pretty old) project to migrate JIRA issues to Github.
Export the issues from JIRA
First, create a full export to XML as described in this guide:
https://confluence.atlassian.com/adminjiracloud/exporting-issues-776636787.html
You'll need the exported entities.xml from JIRA to upload the
issues to your GitHub repository using the GitHub API.
Run the import to GitHub
Run node index.js to use the script

Related

Is there a way to import GitHub issues to JIRA?

My team use Jira and we often work with open source software which are hosted on GitHub.
I often get request from my PM to update the status which can sometimes easily be followed using the GitHub public issue openend on one of those open source project.
Is there a way I can link a GitHub issue to a Jira ticket and sync all the GitHub comment in this Jira ticket ?
Answer is yes, it is.
If you want some manual import, you can check this Atlassian Community post.
As explained in here, you can perform with applying following steps:
Get list of issues in JSON format using following link from the browser
https://api.github.com/repos/\<repo-owner-name>/<repo-name>/issues?state:open
Convert JSON to CSV using any online converter
User Jira's External system import > choose CSV and upload the file.
Or, if you are looking for some programmatic way, you can check following page on zmccdn.

Merge multiple projects into single project TFS/ADO

I was exploring following GitHub page to understand the migration and merge of projects from Azure DevOps Server to Azure DevOps Services
https://github.com/nkdAgility/azure-devops-migration-tools
I see in the documentation, the following feature was mentioned. But, unfortunately, I could not see any relevant documentation for the same. Please help with this.
Merge many projects into a single project
You do it through the configuration file as part of the tool. It requires tinkering and trial and error to get it working but is a very useful. In the config file you state a source and a target and the amend the parama you want and then run the tool. It not very well documented though but is still a powerful tool.

Is there a way to migrate a project board in GitHub to project (beta)?

I have an existing project that uses project boards on GitHub. I want to move all issues (open and closed) to projects (beta) on GitHub. Is there a way to do that automatically? Right now, I only know how to add issues manually to projects (beta).
As far as I know, there is currently no official guide on how to migrate to GitHub Projects (beta). You might want to follow this discussion on the topic: https://github.com/github/feedback/discussions/6141
However, I created a tutorial on how to migrate from the legacy project boards to the new projects (beta) myself: https://github.com/galargh/projects-migration#how-to-migrate-from-github-projects-to-github-projects-beta
It describes how to migrate cards (including column names) by either running a GitHub Actions workflow or a bash script.
Unfortunately, it does require some manual steps because projects (beta) API is not complete yet - the project itself and the Status field options have to be created manually to be precise.
After the migration, I'm also heavily using this action I created https://github.com/protocol/github-api-action-library/tree/master/add-project-items-by-content-query. I use it to periodically populate my projects based on content search queries (e.g. I automated adding all the issues that mention me - https://github.com/galargh/.github/blob/684c316/.github/workflows/add-project-items.yml).
I implemented python script that helps you migrate your project (similar to #galargh's solution) which uses the GraphQL api for the old projects too (might be more future proof) and also allows you to map column names and migrate PRs.
https://github.com/doidor/gh-projects-migration
You can now do this by enabling the Project migration feature in feature preview
Once you enable it you should see a Start migration button when you go to your Classic (not beta) Project Board
Here are the official docs on how to do it

Jira integration in Backstage giving 404 error

I'm currently testing Backstage for my company, and I tried various continuous integration pipelines like Github, Jira, Jenkins, and more. But I'm facing an issue with the Jira plugin. Maybe it's just a bad setup.
In my component, I can see the Jira entity, but every time, it says:
failed to fetch data, status 404: Not Found
When I look in the browser's console (network), I can see this 404, and this is the query used:
http://localhost:7007/api/proxy/jira/api/rest/api/latest/project/undefined
Why do I have undefined? Is it because the jira/project-key variable is not at the right place? Actually, it's in the catalog-info.yaml under metadata.
I followed all documentation I could find, but one section is not enough clear for me. It's about the annotations thing. It says `Add annotation to the yaml config file of a component. I created a component yesterday, but I don't see any file for it.
Thanks in advance.
Ok, I found the solution.
In the documentation, the file, called catalog-info.yaml, is not the one at the Backstage repository's root, but to a file in a different repository that will be used as component template in Backstage.
If you create a new repository (ex a fork from Symfony), you will have to add the file catalog-info.yaml with various informations if you want to use this repository as template for your projects.

How to create a new Azure Website with integration to private Github repo using the Azure REST API?

There are many trivial examples that show how this is done without the Github integration. The Azure Powershell commandlet New-AzureWebsite supports only public repos (can be confirmed from source code [1]). Has anyone tried to create it with a connection to a private repo? It doesn't seem to be documented anywhere.
UPDATE: I've realized this might be something Kudu helps me with.
[1] https://github.com/Azure/azure-powershell/blob/e06a22c22f7a1c8153e9c2fa7c159ae7b1fd1dab/src/ServiceManagement/Services/Commands.Utilities/Websites/Services/GithubClient.cs#L124
We have not added the functionality to powershell. However, you could try using the ARMClient tool below to achieve just that. See its readme and wiki for info.
https://github.com/projectkudu/ARMClient
https://github.com/projectkudu/ARMClient/wiki/Setup-GitHub-publishing-to-Site