Skip to content

CampusTech/snipe2jamf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snipe2jamf

Sync asset data from Snipe-IT to Jamf Pro computers and mobile devices.

snipe2jamf reads asset fields from Snipe-IT and writes them to matching Jamf Pro computers and mobile devices based on serial number. Field mappings are defined in a YAML config file with separate sections for computers and mobile devices.

Features

  • Sync to both computers and mobile devices (iOS, iPadOS, tvOS, watchOS, visionOS)
  • Map any Snipe-IT field (standard or custom) to Jamf Pro purchasing, general, or extension attribute fields
  • Static values for fields like purchased: true
  • Built-in transforms: date formatting, prefix:$, months_to_years, warranty_to_date, type coercion
  • Idempotent — only updates Jamf when values actually differ
  • --dry-run mode to preview changes without writing
  • Filter by --serial, --snipe-id, or --jamf-id for single-device syncs
  • Debug logging with --debug

Installation

Download a binary (recommended)

Grab the latest release for your platform from the Releases page.

Platform Binary
macOS (Apple Silicon) snipe2jamf-darwin-arm64
Linux (x86_64) snipe2jamf-linux-amd64
Linux (ARM64) snipe2jamf-linux-arm64
Windows (x86_64) snipe2jamf-windows-amd64.exe

Install with Go

go install github.com/CampusTech/snipe2jamf@latest

Build from source

git clone https://github.com/CampusTech/snipe2jamf.git
cd snipe2jamf
go build -o snipe2jamf .

Configuration

Copy the example config and fill in your credentials:

cp snipe2jamf.example.yaml snipe2jamf.yaml

See snipe2jamf.example.yaml for all options.

Snipe-IT

Generate a Personal API Token in Snipe-IT under Admin > User Management > your user > Manage API Keys.

Jamf Pro

Create an API Client in Jamf Pro under Settings > API Roles and Clients:

  1. Create an API Role with at minimum:
    • Read Computers and Update Computers (for computer sync)
    • Read Mobile Devices and Update Mobile Devices (for mobile device sync)
  2. Create an API Client with that role and note the Client ID and Client Secret

Field Mappings

Mappings are organized under computers: and mobile_devices: sections. Each mapping has a source (Snipe-IT field), a target (Jamf Pro field), and an optional transform.

Backward compatibility: A flat mappings: list (without sections) is treated as computer mappings.

Source fields (Snipe-IT):

Type Examples
Standard serial, name, asset_tag, model_number, order_number, notes, purchase_date, purchase_cost, warranty_months, supplier.name
Custom custom_fields._snipeit_fieldname_N
Static Use value: "..." instead of source

Computer target fields (Jamf Pro):

Section Fields
Purchasing purchasing.poNumber, purchasing.poDate, purchasing.vendor, purchasing.warrantyDate, purchasing.appleCareId, purchasing.leaseDate, purchasing.purchasePrice, purchasing.lifeExpectancy, purchasing.purchasingAccount, purchasing.purchasingContact, purchasing.leased, purchasing.purchased
General general.assetTag, general.barcode1, general.barcode2
Extension Attributes extensionAttributes.<Attribute Name>

Mobile device target fields (Jamf Pro):

Section Fields
Top-level name, assetTag
Purchasing purchasing.poNumber, purchasing.poDate, purchasing.vendor, purchasing.warrantyExpiresDate, purchasing.appleCareId, purchasing.leaseExpiresDate, purchasing.purchasePrice, purchasing.lifeExpectancy, purchasing.purchasingAccount, purchasing.purchasingContact, purchasing.leased, purchasing.purchased
Extension Attributes extensionAttributes.<Attribute Name>

Note: Mobile devices use warrantyExpiresDate and leaseExpiresDate instead of warrantyDate and leaseDate.

Transforms:

Transform Description
prefix:$ Prepend a string (e.g. $ for currency)
months_to_years Convert months to years (integer division)
warranty_to_date Calculate expiry date from warranty_months + purchase_date
date:FORMAT Reformat date using Go time layout (e.g. date:2006-01-02)
string, int, float, bool Type validation/coercion

Usage

# Validate your config
snipe2jamf validate

# Preview changes (no writes)
snipe2jamf sync --dry-run

# Sync all computers and mobile devices
snipe2jamf sync

# Sync a single device
snipe2jamf sync --serial XXXXX
snipe2jamf sync --snipe-id 123
snipe2jamf sync --jamf-id 456

# Debug output
snipe2jamf sync --debug

# Use a different config file
snipe2jamf sync --config /path/to/config.yaml

How It Works

  1. Fetches computers and/or mobile devices from Jamf Pro (with purchasing and extension attribute data)
  2. For each device, looks up the matching asset in Snipe-IT by serial number
  3. Evaluates each configured field mapping
  4. Compares source value to current Jamf value — skips if already matching
  5. Sends a single PATCH request per device with all changed fields
  6. For computers: pre-populates the update payload from current Jamf values to avoid wiping unmanaged fields (Jamf v3 API replaces entire subsections)
  7. For mobile devices: purchasing updates are nested under the device type (iOS/tvOS) automatically

Requirements

  • Go 1.25+
  • Snipe-IT instance with API access
  • Jamf Pro instance with API Client (OAuth2) credentials

License

MIT

About

Sync asset data from Snipe-IT to Jamf Pro computers

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages