fogbugz-to-github

Migrates FogBugz cases to GitHub issues.

License

License

MIT
Categories

Categories

Github Development Tools Version Controls
GroupId

GroupId

com.sudicode
ArtifactId

ArtifactId

fogbugz-to-github
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

fogbugz-to-github
Migrates FogBugz cases to GitHub issues.
Project URL

Project URL

https://github.com/sudiamanj/fogbugz-to-github
Project Organization

Project Organization

jcabi.com
Source Code Management

Source Code Management

https://github.com/sudiamanj/fogbugz-to-github

Download fogbugz-to-github

How to add to project

<!-- https://jarcasting.com/artifacts/com.sudicode/fogbugz-to-github/ -->
<dependency>
    <groupId>com.sudicode</groupId>
    <artifactId>fogbugz-to-github</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.sudicode/fogbugz-to-github/
implementation 'com.sudicode:fogbugz-to-github:1.0.0'
// https://jarcasting.com/artifacts/com.sudicode/fogbugz-to-github/
implementation ("com.sudicode:fogbugz-to-github:1.0.0")
'com.sudicode:fogbugz-to-github:jar:1.0.0'
<dependency org="com.sudicode" name="fogbugz-to-github" rev="1.0.0">
  <artifact name="fogbugz-to-github" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.sudicode', module='fogbugz-to-github', version='1.0.0')
)
libraryDependencies += "com.sudicode" % "fogbugz-to-github" % "1.0.0"
[com.sudicode/fogbugz-to-github "1.0.0"]

Dependencies

compile (6)

Group / Artifact Type Version
org.apache.commons : commons-lang3 jar 3.6
com.google.guava : guava jar 20.0
org.slf4j : slf4j-api jar 1.7.21
com.jcabi : jcabi-github jar 0.33
org.seleniumhq.selenium : selenium-java jar 3.4.0
org.apache.commons : commons-text jar 1.1

provided (2)

Group / Artifact Type Version
javax.json : javax.json-api jar 1.1
org.projectlombok : lombok jar 1.16.18

test (5)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-core jar 2.10.0
org.jooq : joor jar 0.9.6
com.github.tomakehurst : wiremock-standalone jar 2.6.0
org.slf4j : slf4j-simple jar 1.7.21

Project Modules

There are no modules declared in this project.

FogBugz to GitHub (FB2GH)

Logo

FB2GH is designed to help you programmatically migrate your FogBugz cases into GitHub issues.

Build Status Coverage Maven Central Javadoc

Usage

// Login to FogBugz
// How to get an API token: http://help.fogcreek.com/8447/how-to-get-a-fogbugz-xml-api-token
FogBugz fogBugz = FBFactory.newFogBugz(fogBugzURL, fogBugzAPIToken);

// You can also get a token through FB2GH
FogBugz otherFb = FBFactory.newFogBugz(fogBugzURL, fogBugzEmail, fogBugzPassword);
System.out.println(otherFb.getAuthToken());

// FogBugz::searchCases(String) functions exactly like the search box in FogBugz
List<FBCase> caseList = fogBugz.searchCases("123");

// Login to GitHub
GitHub github = GHFactory.newGitHub(githubOAuthToken); // Using OAuth (https://github.com/settings/tokens/new)
GitHub otherGh = GHFactory.newGitHub(githubUsername, githubPassword); // Using basic authentication
GHRepo ghRepo = github.getRepo(repoOwner, repoName); // GitHub repository to migrate to

// Migrate caseList to ghRepo
Migrator migrator = new Migrator.Builder(fogBugz, caseList, ghRepo).build();
migrator.migrate();

Configuration

The Migrator class uses the builder pattern which makes it flexible in terms of customization.

For instance, here's how to define your own labeling function:

Migrator migrator = new Migrator.Builder(fogBugz, caseList, ghRepo)
    .fbCaseLabeler(new FBCaseLabeler() {
        @Override
        public List<GHLabel> getLabels(FBCase fbCase) {
            List<GHLabel> list = new ArrayList<GHLabel>();
            list.add(new GHLabel("F" + fbCase.getId(), "92602c"));
            if (fbCase.getSalesforceCaseId() != 0) {
                list.add(new GHLabel("S" + fbCase.getSalesforceCaseId(), "178cda"));
            }
            list.add(new GHLabel(fbCase.getCategory()));
            list.add(new GHLabel(fbCase.getPriority()));
            return list;
        }
    })
    .build();

You can set as many options as you want before building, like so:

Migrator migrator = new Migrator.Builder(fogBugz, caseList, ghRepo)
    .closeIf(new Predicate<FBCase>() {
        @Override
        public boolean test(FBCase fbCase) {
            return !fbCase.getStatus().equals("Active");
        }
    })
    .usernameMap(Collections.singletonMap("Jonathan Sudiaman", "sudiamanj"))
    .postDelay(500L)
    .build();

Troubleshooting

Why am I seeing the following message?

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

This project uses SLF4J, which allows end users to choose a logging facility at runtime. If you don't care about logging and want to disable this message, simply add slf4j-nop as a dependency. If you want to use SLF4J's logger, use slf4j-simple. For more options, see SLF4J user manual.

Versions

Version
1.0.0
0.1.0