Automating test results in spreadsheets using Jenkins data

Hey everyone! I’m new to the field and could use some help with my first project. I need to create a spreadsheet that automatically updates with Jenkins build results. The sheet should have columns for Ticket ID, Test Case ID, Pass/Fail status, and Comments.

I’m wondering if there’s a way to link Jenkins to the spreadsheet so it fills in the Pass/Fail and Comments columns based on build outcomes. For example:

  • If a build passes: Mark as ‘Pass’ with ‘Build passed’ in Comments
  • If a build fails: Mark as ‘Failed’ and copy the failure reason from Jenkins

Is this doable? Any tips on how to set it up or better ways to track this info would be great. Thanks!

Here’s a quick example of what I’m thinking:

| Ticket ID | Test Case ID | Pass/Fail | Comments        |
|-----------|--------------|-----------|-----------------|
| TICK-001  | TC-101       | Pass      | Build passed    |
| TICK-002  | TC-102       | Failed    | Compile error   |
| TICK-003  | TC-103       | Pass      | Build passed    |

Let me know if you need more details!

Integrating Jenkins with spreadsheets for test result tracking is certainly achievable and quite useful. I have built a similar system where a post-build action in Jenkins triggers a custom script that uses the Jenkins REST API to fetch build data. The script processes the results and then updates a Google Sheets document via its API using Python. I used the requests and google-auth libraries to handle the API calls and authentication, and setting up OAuth2 was crucial. It is also important to handle issues like network interruptions and API rate limits, and including a timestamp for updates can be very helpful. This method automates manual reporting and offers real-time test insights.

hey tom, you can totally set up this automation with jenkins. use its api to grab build data and update your spreadsheet via a script (python is good). google sheets api makes it easy. best of luck!

I’ve implemented a similar system using Jenkins’ post-build actions and a custom Python script. Here’s what worked well for me:

  1. Set up a post-build action in Jenkins to trigger your script.
  2. Use Jenkins’ REST API to fetch build data (status, failure reasons, etc.).
  3. Process this data in your script to match your spreadsheet format.
  4. Use Google Sheets API to update your spreadsheet automatically.

Key things to consider:

  • Properly handle API authentication and rate limits.
  • Include error handling for network issues or API failures.
  • Add a timestamp column to track when each update occurred.

This approach saved our team hours of manual work each week and provided real-time visibility into our test results. Feel free to ask if you need more specific implementation details!