rtcTo / rtc2jira

Move your IBM RTC WorkItems to Atlassian Jira or any other Issue Tracker
https://rtc.to
GNU General Public License v2.0
11 stars 16 forks source link

Problems while transitioning issue #24

Closed alexemmons closed 6 years ago

alexemmons commented 6 years ago

I'm having trouble getting the Status set correctly on my JIRA issues.

This is probably due to custom Statuses/Workflows that we have created in RTC, but I'm looking for guidance as to how to re-create those workflows in JIRA and what to modify in Java classes and/or settings.properties to set them correctly.

I am recieving this error message:

SEVER Problems while transitioning issue: {"errorMessages":["It seems that you have tried to perform a workflow operation (inprogressToDone) that is not valid for the current state of this issue (RTCJIR-1602).

The error message is valid. The 'Dummy' issue is created as TO DO, therefore it cannot complete the inprogressToDone transition.

I also noticed that someone else has had this exact problem on your end (possibly commited by accident?), and I'm wondering if anyone figured it out: https://github.com/rtcTo/rtc2jira/blob/master/DefaultExportLog.log

to.rtc.rtc2jira.exporter.jira.JiraExporter doTransition SCHWERWIEGEND: Problems while transitioning issue: {"errorMessages":["It seems that you have tried to perform a workflow operation (OpenToDone) that is not valid for the current state of this issue (WOR-25705).

Also wanted to add that this tool is working better than my team and I expected, aside from this issue, so thanks to all who have contributed!

alexemmons commented 6 years ago

Looks like most of the work in this area was done in https://github.com/rtcTo/rtc2jira/commit/5767b110785c0c923d1f23e28deb9a6b213f7ba3 by @gustafhansen

WtfJoke commented 6 years ago

Hi Alex

I wasnt very involved in this project, so I cant help that much. Looks like the log file was commited by accident, youre right. However, wouldnt be an option to adjust your jira workflow while doing the import? And afterwards readjusting it to your desired workflow?

Or do I missunderstand you?

Can you also provide a stacktrace (if it differs from the other).

alexemmons commented 6 years ago

Thank you for your response. I do believe that I will need to re-create our RTC workflow in JIRA, thank you for the link, as I am new to JIRA so everything helps! I am wondering if that will be enough, or if I will need to add the custom workflow statuses, transitions, etc. somewhere inside rtc2jira as well. I am slowly working my way through the codebase trying to figure that out now. I’m also wondering what’s happening in my case, where it’s trying to transition inprogressToDone when the Dummy issue is in TO DO. That won’t work regardless of workflow.

I am mostly just reaching out here to anyone who has/hasn’t had success with migrating a custom workflow from RTC with this tool (as it looks like someone has at least tried).

Thank you for your time.

This is my stacktrace, notice that this time it had a generic Internal server error where the other time it was a specific message It seems that you have tried to perform a workflow operation (inprogressToDone) that is not valid for the current state of this issue. I am seeing different behavior on subsequent runs, or by putting the issue in a different state before running the migration. I Will continue debugging to try to find the pattern.

2017-11-04 15:33:36:039 SEVER Problems while transitioning issue: {"errorMessages":["Internal server error"],"errors":{}} [JiraExporter]Error while updating in Jira java.lang.Exception at to.rtc.rtc2jira.exporter.jira.JiraExporter.updateIssueInJira(JiraExporter.java:490) at to.rtc.rtc2jira.exporter.jira.JiraExporter.persistIssue(JiraExporter.java:282) at to.rtc.rtc2jira.exporter.jira.JiraExporter.updateItem(JiraExporter.java:233) at to.rtc.rtc2jira.exporter.jira.JiraExporter.createOrUpdateItem(JiraExporter.java:158) at to.rtc.rtc2jira.ExportManager.export(ExportManager.java:65) at to.rtc.rtc2jira.Main.main(Main.java:24)

alexemmons commented 6 years ago

I have mostly worked my way through this issue. Here is what I had to do:

For states that already existed in JIRA: Add a new step to my Workflow linked to the desired Status. Add a new Transition from To Do to the desired Status (since the 'Dummy' Issues are originally created as To Do and then transitioned to the final State). Take the id from that new transition and put in the corresponding entry in StateEnum.getMigrationTransitionMap (e.g. transitionMap.put(migr_resolved, "121")).

For states that didn't already exist in JIRA I had to create them, then add a new enum in StateEnum (setting isFinished to true if needed) and then following the steps above to add the new Workflow step and Transition map entry.

Beyond this I have found that I needed to adjust most of the Enums/mappings in the program to match my JIRA instance such as IssueLinkType, IssueType, ResolutionEnum, SeverityEnum, and more.

All in all I'm learning how to work with and customize this code base, but it desperately needs more documentation and instructions on how to actually use and modify the tool to extract the most possible data from RTC.

WtfJoke commented 6 years ago

Thanks alex for your help. We welcome any improvements (in documentation and elsewhere).

If you like to, you can open pull request or contribute in the wiki. I also think your comments, could help some other user if its packed in the wiki.