Open Doldge opened 7 months ago
additional notes:
I grepped around the code base but couldn't find any code that looked like it actually did the issue import.
imported_data
column of importers
but AFAICT nothing is setting data in that columnimporters.data
only appears to have a summary of the issue & epic numbers but not the actual issue & epic data.This is a follow on from #451
facing the same issue. please help. i successfully imported it in my cloud instance but cant in self hosted. also emails arent being sent.
@Doldge, @Gauravoid, currently, integrations and importers are only available on the cloud version. This is because we utilize a separate server for communication with other services. For self-hosted versions, we aim to spare our users from managing additional servers for integrations and importers. Therefore, we are developing an architecture that simplifies the process for users, eliminating the need to set up multiple servers. This development has already begun (see https://github.com/makeplane/plane/pull/3248 and https://github.com/makeplane/plane/tree/feat/segway-implementation), and we plan to include it in the next few releases.
In the meantime, if you could provide details on use cases or additional context, such as:
Answers to these questions will help us enhance your experience.
Hi @vihar
thanks for getting back to me.
In my specific instance, I've only got a single Jira Project that I'm looking to migrate. The project summary is:
As far as user migration goes, I'm happy to just manually sort that after the project is migrated.
Hello @Doldge,
Here is the code that I come up with: jira.py.zip I also uploaded the file in zip as the following formatting is not the best, but anyway, the code is here to be checked as well: ` import requests from requests.auth import HTTPBasicAuth from sentry_sdk import capture_exception
def jira_project_issue_summary(email, api_token, project_key, hostname): try: auth = HTTPBasicAuth(email, api_token) headers = {"Accept": "application/json"}
# Check API version for Jira.
test_url_v3 = f"https://{hostname}/rest/api/3/project/{project_key}"
test_url_v2 = f"https://{hostname}/rest/api/2/project/{project_key}"
# Try API v3 if not valid than use API v2
response = requests.get(test_url_v3, headers=headers, auth=auth)
if response.status_code == 200:
api_ver = "3"
else:
api_ver = "2"
issue_url = f"https://{hostname}/rest/api/{api_ver}/search?jql=project={project_key} AND issuetype=Story"
issue_response = requests.request(
"GET", issue_url, headers=headers, auth=auth
).json()["total"]
module_url = f"https://{hostname}/rest/api/{api_ver}/search?jql=project={project_key} AND issuetype=Epic"
module_response = requests.request(
"GET", module_url, headers=headers, auth=auth
).json()["total"]
status_url = f"https://{hostname}/rest/api/{api_ver}/status/?jql=project={project_key}"
status_response = requests.request(
"GET", status_url, headers=headers, auth=auth
).json()
if api_ver == "3":
labels_url = f"https://{hostname}/rest/api/{api_ver}/label/?jql=project={project_key}"
labels_response = requests.request(
"GET", labels_url, headers=headers, auth=auth
).json()["total"]
else:
labels_url = f"https://{hostname}/rest/api/{api_ver}/jql/autocompletedata/suggestions?fieldName=labels"
labels_response = requests.request(
"GET", labels_url, headers=headers, auth=auth
).json()
if api_ver == "3":
users_url = (
f"https://{hostname}/rest/api/{api_ver}/users/search?jql=project={project_key}"
)
else:
users_url = f"https://{hostname}/rest/api/{api_ver}/user/search?username=."
users_response = requests.request(
"GET", users_url, headers=headers, auth=auth
).json()
if api_ver == "3":
return {
"issues": issue_response,
"modules": module_response,
"labels": labels_response,
"states": len(status_response),
"users": (
[
user
for user in users_response
if user.get("accountType") == "atlassian"
]
),
}
else:
return {
"issues": issue_response,
"modules": module_response,
"labels": labels_response,
"states": len(status_response),
"users": users_response
}
except Exception as e:
capture_exception(e)
return {"error": "Something went wrong could not fetch information from jira"}
` it supports both API versions of Jira (API v3 for Cloud and API v2 for self hosted Jira Server and Data Center) but it doesn't support PAT (Personal Access Tokens) in some cases this kind of authentication is forced instead of basic authentication - This I have in plan to develop in future as no time for it at the moment.
The file that should be replaced (make a backup of it first) is located here: apiserver/plane/utils/importers/jira.py
I did test the file as it is (without using Plane) and worked on both API versions, so this is why I asked to make a backup first, before modifying it, even better - if you have a playground installation of Plane to test this out.
I hope the code will be helpful in the future development of Jira migration to Plane.
All the best and a Happy new year to everyone! George
Hi George [ @gxgl ],
I appreciate your intention to provide some assistance with this.
Unfortunately your proposed file/change doesn't help, as the issue is that the jira_project_issue_summary
function just reports a summary of what the import is intending to do [i.e. collects ['totals']
], but doesn't actually do the import of the data.
I look forward to further updates from @vihar; In the mean time, let me know if there's anything I can do to help move this forward [I'm a python dev by day, so can provide assistance if needed].
The number of projects being migrated: >200 The estimated total number of issues being migrated: ~60k
Hi @vihar are there any updates on this? (I've seen that there is a segway PRs, one aimed to v0.16 was closed and other was merged into v0.15. The latter seems to be aim for cloud host though).
Not being able to import existing Jira project quite hurts an attempt to do a tryout as a self-hosted.
Running v0.18-dev and can't find any importers. They're completely missing:
Have they been removed? Best Regarsd.
Hi @florian-obradovic as explained above in this thread, JIRA importers only worked on Cloud. We are working on getting this in self hosted deployments soon. Will update this thread.
@gchanchal 😂 sorry for not reading this, stupid me.
My Datacenter Environment:
My Cloud Environment:
Is there an existing issue for this?
Current behavior
When I import a project from Jira on my self-hosted instance of plane, running v0.13.2, I expect the Jira Epics & "stories" to import into my plane project.
However, this does not happen.
Steps to reproduce
jira_project_issue_summary
python function and change theissue_url
to importissuetype=Task
instead ofissuetype=Story
worker
[celery] docker logs to confirm thatplane.bgtasks.importer_task.service_importer
is startedplane.bgtasks.importer_task.service_importer
finishesBrowser
Mozilla Firefox
Version
Self-hosted v0.13.2