UE4 to Trello for a Bug Reporter

Hi everyone. I decided today to create a bug reporter that posts cards to Trello, since Trello is well known in the community. This could be a good way for you to record the bugs of the game if your game is in early stages and you playtest a lot.

So this is a tutorial to describe how to create such a bug reporter using HTTP requests in C++.

Note: This was created in UE 4.7.6

Trello
If you don’t know trello yet, check it out. It is basically a project management tool. You will need an account, create a board and create a list in that board before you start with this tutorial.

The trello api uses a lot of ID’s and keys, so first I will describe how to get all of them.

Request
Every api request for trello starts with: https://api.trello.com/1/

We will be filling in this request:
https://api.trello.com/1/cards?key=<yourkey>&token=<yourtoken>&name=My+new+card+name&desc=My+new+card+description&idList=<thelist>

Key
First you need to generate a key with your trello account by going to this page:
https://trello.com/app-key

Board
Get the id from the correct board by going here: https://trello.com/1/members/me/boards?fields=name

Token
To get writing access to the board you need to have a token. You can get one by using the call below. Don’t forget to replace substitutewithyourapplicationkey with your key.

https://trello.com/1/authorize?key=substitutewithyourapplicationkey&name=Your+Game+Name&expiration=never&response_type=token

After you have done that and you are logged in Trello you will get a notification which you have to accept. It goes to a page after that with the token.

List
Then you need to get the correct list to add the card to. Replace substitutewithyourboardid with your board id.

https://api.trello.com/1/boards/substitutewithyourboardid/lists

You will get all lists in that board. You have to get the id of the list you want to use.

Labels
You have to do the same thing as the list to get the id of the label you want

https://api.trello.com/1/boards/substitutewithyourboardid/labels

C++ Code
First add the HTTP module to your project build file with:

PublicDependencyModuleNames.AddRange(new string] { “HTTP” });

I added the function to the gamemode, but you can put it where you want it. Here is the header:


#pragma once

#include "GameFramework/GameMode.h"
#include "Http.h"
#include "TrelloProjectGameMode.generated.h"

UCLASS()
class TRELLOPROJECT_API ATrelloProjectGameMode : public AGameMode
{
	GENERATED_BODY()
	
public:
	UFUNCTION(BlueprintCallable, Category = "Trello")
	void ReportBug(FString Name, FString Description);

	UFUNCTION(BlueprintImplementableEvent)
	void ReportBugComplete(bool bWasSuccessful);

private:
	void OnReportBugComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful);
};

And below is the source file. Add all the IDs you got to the strings at the top of the file.


#include "TrelloProject.h"
#include "TrelloProjectGameMode.h"

const FString TrelloCards = "https://api.trello.com/1/cards?";
const FString Key = "";
const FString Token = "";
const FString Label = "";
const FString List = "";

void ATrelloProjectGameMode::ReportBug(FString Name, FString Description)
{
	TSharedRef<IHttpRequest> Request = FHttpModule::Get().CreateRequest();
	Request->SetVerb("POST");

	//Replace all the spaces with +
	Name.Replace(L" ", L"+");
	Description.Replace(L" ", L"+");

	//Construct the http url
	FString URL = TrelloCards +
		"key=" + Key +
		"&token=" + Token +
		"&name=" + Name +
		"&desc=" + Description +
		"&idLabels=" + Label +
		"&idList=" + List;

	Request->SetURL(URL);
	//Call OnReportBugComplete once the request is done
	Request->OnProcessRequestComplete().BindUObject(this, &ATrelloProjectGameMode::OnReportBugComplete);
	//Do the request
	Request->ProcessRequest();
}

void ATrelloProjectGameMode::OnReportBugComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
{
	//Go to blueprints
	ReportBugComplete(bWasSuccessful);
}


I put this together really fast so, I am not going to explain the blueprints/UMG. So you can check that out in the download. I would love to hear if you have any questions!!!

You can download the project here.

Later

I’m not sure if Trello lets you attach metadata fields to a card, but you should consider adding parse-able metadata information for every bug reported. Information like, Level, Position, Look Direction, possibly lots more. Then you can build a simple viewer app that loads levels and automatically moves the developer to locations, so that the developer can see where the bug was reported, and what the user was looking at. Helps a lot when users are reporting bugs like, “door wont open”. What door, where?

That is a nice one :). Didn’t really want to continue with this and I thought it might help some people. If I am bored another evening I might take a look at it!

This is pretty neat , thanks for sharing =)

Hey ,

I downloaded the project file and I could not get it to compile. I get the following message:

C:\UE4\TrelloProject\Source\TrelloProject\Resources\Windows\TrelloProject.rc(68): error RC2135: file not found: …/…/…/…/Build/Windows/Application.ico

do you need to include the build file with the zip file?

You are right! I updated it, thanks for letting me know!

Thanks, nice little snippet. Very helpful indeed :slight_smile:

That’s what I was aiming for ! :slight_smile:

I’m happy to inform you that our upcoming UE4 Plugin ODIN Tracker will support these features and then some :slight_smile:

More info at: ODIN Tracker | Plugin - Marketplace - Epic Developer Community Forums

Thanks this may help us with ODIN Tracker R&D when we get around to adding support for Trello but for the time being we are currently just focusing on creating a solid foundation with JIRA then expanding from there :smiley:

Happy if it helps ! :slight_smile: