# Custom Data in Build Scans

DevFeed: [Custom Data in Build Scans](<https://devfeed.tech/articles/custom-data-in-build-scans-24604.md>)

Original publisher: [Read original article](<https://blog.gradle.org/custom-data-in-build-scans>)

Author: Craig Atkinson

Published: 2017-01-04T05:00:00Z

Content type: tutorial

Language: en

Sources: [The Gradle Blog](<https://devfeed.tech/sources/the-gradle-blog.md>)

Topics: [Gradle](<https://devfeed.tech/topics/gradle.md>), [ci](<https://devfeed.tech/topics/ci.md>), [GitHub](<https://devfeed.tech/topics/github.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [build](<https://devfeed.tech/tags/build.md>), [ci](<https://devfeed.tech/tags/ci.md>), [code](<https://devfeed.tech/tags/code.md>), [github](<https://devfeed.tech/tags/github.md>), [gradle](<https://devfeed.tech/tags/gradle.md>)

## AI overview

This tutorial explains how to add custom data to Gradle build scans using tags, links, and key-value values. These additions can provide context such as CI status, branch information, local changes, source-code links, and CI result links.

## Source excerpt

Build scans are a great way to easily share data about your build, but what if your team wants to add their own data to those build scans? They can! In addition to the extensive information automatically captured in build scans, you can attach your own custom data to provide even deeper insights into your build. This custom data can take the form of tags, links, and arbitrary custom values in a key-value format. By adding custom data to your build scans you can make it easy to find builds of a certain type, give quick links to the applicable source code commit on GitHub, add helpful CI build information, and much more. Then, when you share the single build scan link with a teammate, they get quick and easy access to a plethora of information about your build, making it easier for them to diagnose build environment issues, fix test failures, and so on. If build scans are new to you, you can learn about them in our introductory blog post on the topic. You can also find more details in the Build Scans User Manual, explore some example build scans or experiment with this sample build scan project. Now let's go through some examples of adding custom data into your build scans (see the user manual for additional examples). Tags Let's start with the simplest type of custom data: tags. Tags are a way to add simple pieces of metadata to your build scan. You can use tags to add context to your build, such as whether the build was run locally or on a CI server, whether the build had any local changes, the error type of a failing build, etc. Here is an example build scan that tags the build as having: run on CI come from the master branch included local code changes ("dirty") For example, to attach a tag showing whether the build ran locally or on a CI server, you can add the following to its build script: if (System.getenv("CI")) { buildScan.tag "CI" } else { buildScan.tag "LOCAL" } The tag is then displayed under the project name when viewing the build scan: Links In addition