CHALLENGE DETAIL

Github Team Management with Salesforce.com

OVERVIEW

CODE

Here at CloudSpokes, we love Github just as much as we love Salesforce.com. They are great platforms but ... sadly... are independent of one another. We want you to make our lives easier by allowing us to manage our Github team members from Salesforce!

When a member is participanting in a challenge we want to add them to a specific Github team. When their status chagnes to "watching" or they are removed as a particiapnt, we want to remove them from the Github team.

REQUIREMENTS

Create the following Custom Objects in DE org:

1. Challenge__c (all you need is a name field)

2. Member__c

  • Name
  • Email__c
  • Github__c (text 80)

3. Challenge_Participant__c

  • Challenge__c (master:detail to challenge)
  • Member__c (master:detail to member)
  • Status__c (picklist: Watching, Registered, Submitted)

 

Please implement the following requirements:

    1. When a record is inserted or updated with the status OTHER than "Watching", the corresponding member's Github user is added to the team.
    2. When a record is inserted or updated with the status of "Watching", remove the corresponding member's Github user from the team.
    3. When a Challenge Participant record is deleted, remove the corresponding member's Github user from the team.
    4. Implementation takes advantage of @future method to perform transactions with Github API.

    SUBMISSION DETAILS

    Upload all your source code as a zip (you can simply zip up your Eclipse project for convenience) and provide any documentation and/or instructions that are needed. Please be clear and concise with any setup instructions.

    A video of your application using Jing or Youtube is required. An unmanaged package for installation is also required.

    Your submission will be judged by a panel of peers based upon this criteria. If you would like to request an extension, please read Can challenge deadlines be extended for more time? on our FAQ. We do not want to grant extensions unless there is a valid reason.

    ADDITIONAL INFO

    We have a Github Organization setup for development. Send an email to support@cloudspokes.com with the subject "2634 - Github Info". Include your Github username and we'll add you to the Organization and create a team for you to use for development.

    PARTICIPATION


    DISCUSSION

    ChrisBland
    Hey Jeff - I know its not in the requirements but I thought about pointing this out. Would you like us to add a field called Github_Team__c on to the Contest__c object or on another object? That way it will add to the correct team based on the value on the contest, otherwise we will have to use custom settings or hardcode the team id (which would you prefer?)
    ChrisBland, Aug 07, 2013 at 18:56 PM reply
    jeffdonthemic
    Great idea but not needed for THIS challenge. We will for a future one though. Right now, we are going to add everyone that registers to a "All Members" team. For individual challenges we may also add them to a "Challenge 5000 Team". HTH
    jeffdonthemic (admin), Aug 08, 2013 at 08:28 AM
    fourq
    I've already used a custom setting for this. I will be submitting in the next few minutes.
    fourq, Aug 07, 2013 at 20:26 PM reply
    swarna_gopalan
    Hi All, Did anybody get a *Read Time Out* error when using the *PUT* call to add the user to team? Removing works but I'm having trouble with the adding part. The same works through Poster / Advanced Rest Client. I tried setting a Timeout but that doesn't work too. (Using Basic Auth)
    swarna_gopalan, Aug 09, 2013 at 21:25 PM reply
    cloudspokeman
    Hi! I have the same problem than you, Do you find a solution??
    cloudspokeman, Aug 10, 2013 at 12:03 PM
    swarna_gopalan
    Unfortunately, no.. If I increase the timeout period, I get a 502, bad gateway error. Otherwise a Read Timeout. Weird that it's working through Poster / Advanced Rest client and not through SF.
    swarna_gopalan, Aug 10, 2013 at 21:47 PM reply
    ChrisBland
    @swarma & @cloudspokeman - I believe the issue you are having is related to not setting your headers correctly, you should be using:
    HttpRequest req = new HttpRequest();
    req.setHeader('Accept', 'application/json');

    In addition, when making a call to a PUT/POST resource, you are going to want to ensure that your body is set in the HttpRequest even if you are not sending data. Otherwise this will cause you to error out. You can do this by setting the body to an empty string:
    req.setBody('');

    Hope that helps!
    ChrisBland, Aug 10, 2013 at 23:02 PM reply
    swarna_gopalan
    Hey Chris, that works! The setbody was missing. Thanks a lot, been breaking my head for this :)
    swarna_gopalan, Aug 10, 2013 at 23:11 PM reply

    The discussion board is closed for this challenge.



    PARTICIPATION

    17 members participating with 8 registered

    TECHNOLOGIES

    Other | Salesforce.com | Apex | API

    WINNER SELECTED

    Ended Aug 11, 2013 at 6:00 AM
    Winner Announced on August 18, 2013
    View the challenge results
    Give us your feedback about this challenge.

    PRIZES

    Total: $750
    1st $500
    2nd $250

    SHARE

    Chrome Extension

    Install the CloudSpokes Chrome Extension for quick and easy access to the latest CloudSpokes challenges, your payments, leaderboards and more!