Announcement

Collapse
No announcement yet.

UE4 to Trello for a Bug Reporter

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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=s...nse_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/subs...rboardid/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/subs...boardid/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:

    Code:
    #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.

    Code:
    #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
    Last edited by YannickLange; 05-08-2015, 01:27 AM.

    #2
    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?

    Comment


      #3
      Originally posted by NickDarnell View Post
      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!

      Comment


        #4
        This is pretty neat Yannick, thanks for sharing =)
        W3 Studios

        Comment


          #5
          Hey Yannick,

          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?
          W3 Studios

          Comment


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

            Comment


              #7
              Thanks, nice little snippet. Very helpful indeed
              Particle Editor Extension: Marketplace Page | Documentation
              Code plugin which extends your particle effect toolbox with new possibilities.


              SVG Importer Plugin: Marketplace Page | Gumroad Page
              Import SVG (scalable vector graphics) files as rasterized rendering or as multi-channel signed distance field.

              Comment


                #8
                Originally posted by Cultrarius View Post
                Thanks, nice little snippet. Very helpful indeed
                That's what I was aiming for !

                Comment


                  #9
                  Originally posted by Nick Darnell View Post
                  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?
                  I'm happy to inform you that our upcoming UE4 Plugin ODIN Tracker will support these features and then some

                  More info at: https://forums.unrealengine.com/show...racker-for-UE4

                  Originally posted by YannickLange View Post
                  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!
                  Thanks Yannick 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
                  Regards,
                  Benjamin D. Smith

                  Founder & CEO | Binary Sword Pty Ltd
                  Currently working on: ODIN Tracker (UE4 Plugin)

                  Comment


                    #10
                    Happy if it helps !

                    Comment

                    Working...
                    X