Why Automate JSM from the CLI?
Jira Service Management (JSM) is the backbone of IT service desks, but the web UI was built for point-and-click -- not for automation. If your team manages incidents, handles customer onboarding, or tracks SLA compliance, you already know the pain: clicking through portals to triage requests, manually adding customers to service desks, and switching between dashboards to check queue depths.
A JSM CLI eliminates that friction. With atlassian-cli, every JSM operation becomes a scriptable command. Here's what changes:
- Incident response speed. Triage requests, transition statuses, and add comments from the terminal in seconds. No portal loading, no context switching.
- Customer onboarding scripts. Create customers and add them to service desks in a single pipeline step. Automate what used to be a manual admin task.
- SLA monitoring. Query SLA metrics for any request and pipe the output to monitoring tools. Build dashboards from CLI output instead of screen-scraping.
- Queue automation. List queue contents, filter by priority, and route requests -- all from a cron job or CI/CD pipeline.
- Cross-product scripting. Since atlassian-cli covers Jira, Confluence, Bitbucket, and JSM in one binary, you can chain JSM commands with Jira issue updates or Confluence KB article lookups in a single script.
Getting Started
Install
atlassian-cli is a single Rust binary with no runtime dependencies. Install via Homebrew, Cargo, or download a pre-built binary from GitHub Releases.
# Homebrew (macOS / Linux)
brew tap omar16100/atlassian-cli
brew install atlassian-cli
# Cargo (Rust toolchain)
cargo install atlassian-cli
# Verify
atlassian-cli --version
Authentication
JSM uses the same Atlassian Cloud API token as Jira and Confluence. If you already have a profile configured, it works for JSM immediately -- no additional setup needed. If you're starting fresh, create a token at id.atlassian.com and configure a profile:
# Add a profile with your Atlassian credentials
atlassian-cli auth login \
--profile work \
--base-url your-domain.atlassian.net \
--email you@company.com \
--token $ATLASSIAN_API_TOKEN \
--default
# Verify authentication
atlassian-cli auth test --profile work
Credentials are stored with AES-256-GCM encryption in ~/.atlassian-cli/config.yaml. Profile support means you can manage multiple Atlassian instances (dev, staging, production) and switch between them with --profile.
Service Desk Operations
The jsm servicedesk subcommand lets you list and inspect your service desks. This is typically the first thing you run to discover desk IDs, which are required for filtering requests and managing customers.
# List all service desks
atlassian-cli jsm servicedesk list --limit 10
# Get details for a specific service desk (by ID)
atlassian-cli jsm servicedesk get 1
# List organizations attached to a service desk
atlassian-cli jsm servicedesk organizations 1
# List customers of a service desk
atlassian-cli jsm servicedesk customers 1 --limit 25
The servicedesk get command returns the desk name, project key, project ID, and portal URL. Use --format json to pipe the output into jq or downstream scripts.
Request Management
Requests are the core of JSM. The jsm request subcommand covers the full lifecycle: listing, creating, viewing, transitioning, and commenting.
List and view requests
# List recent requests across all service desks
atlassian-cli jsm request list --limit 10
# Filter by service desk
atlassian-cli jsm request list --servicedesk-id 1 --limit 20
# Get full details for a specific request
atlassian-cli jsm request get SD-123
# View status history
atlassian-cli jsm request status SD-123
Create a request
# Create a new service request
atlassian-cli jsm request create \
--servicedesk-id 1 \
--request-type-id 10 \
--summary "VPN access not working after password reset" \
--description "User reports VPN disconnects immediately after auth."
Transition and comment
# List available transitions for a request
atlassian-cli jsm request transitions SD-123
# Transition the request (use the transition ID from above)
atlassian-cli jsm request transition SD-123 --transition "21"
# Add a public comment
atlassian-cli jsm request add-comment SD-123 \
--body "Investigating. Will update within 30 minutes." \
--public
# Add an internal note (not visible to customers)
atlassian-cli jsm request add-comment SD-123 \
--body "Checked VPN logs -- auth timeout on RADIUS server."
# List comments on a request
atlassian-cli jsm request comments SD-123
Request management also supports participants and notifications. Add watchers with jsm request add-participant, or subscribe to updates with jsm request subscribe.
Customer Management
The jsm customer and jsm servicedesk subcommands handle customer lifecycle: creating portal users, adding them to service desks, and managing organizations.
# Create a new customer
atlassian-cli jsm customer create \
--email "jane.doe@acme.com" \
--display-name "Jane Doe"
# Add customer to a service desk
atlassian-cli jsm servicedesk add-customer 1 \
--account-id 5b10a2844c20165700ede21g
# Remove customer from a service desk
atlassian-cli jsm servicedesk remove-customer 1 \
--account-id 5b10a2844c20165700ede21g
# List organizations
atlassian-cli jsm organization list --limit 10
# Create an organization
atlassian-cli jsm organization create --name "Acme Corp"
# Add user to an organization
atlassian-cli jsm organization add-user 5 \
--account-id 5b10a2844c20165700ede21g
# Add organization to a service desk
atlassian-cli jsm servicedesk add-organization 1 --org-id 5
This enables fully scripted customer onboarding: create the customer, assign them to an organization, and grant access to the appropriate service desk -- all in a single shell script.
Queues and SLA Tracking
Queues and SLAs are critical for ITSM operations. The CLI provides direct access to both.
Queues
# List queues for a service desk
atlassian-cli jsm queue list 1
# Get queue details
atlassian-cli jsm queue get 1 10
# List issues in a specific queue
atlassian-cli jsm queue issues 1 10 --limit 25
SLA tracking
# List SLAs for a request
atlassian-cli jsm sla list SD-123
# Get specific SLA details
atlassian-cli jsm sla get SD-123 --sla-id "time-to-first-response"
Pipe SLA output to monitoring systems or alerting tools. For example, query SLA status as JSON and feed it into a Slack webhook to notify on-call engineers when an SLA is approaching breach.
Request Types and Knowledge Base
Request types
Request types define what kind of tickets customers can raise. Use the CLI to inspect available types, their fields, and groupings.
# List all request types
atlassian-cli jsm request-type list
# List request types for a specific service desk
atlassian-cli jsm request-type list --servicedesk-id 1
# Get request type details
atlassian-cli jsm request-type get 1 10
# List fields required for a request type
atlassian-cli jsm request-type fields 1 10
# List request type groups
atlassian-cli jsm request-type groups 1
Knowledge base
Search knowledge base articles linked to your service desks. Useful for building self-service bots or integrating KB content into incident response runbooks.
# Search knowledge base articles
atlassian-cli jsm kb search --query "VPN troubleshooting"
# Search within a specific service desk
atlassian-cli jsm kb search \
--query "password reset" \
--servicedesk-id 1 \
--limit 5
Real-World Workflows
Incident response automation
When a monitoring alert fires, automatically create a JSM request, transition it to "In Progress", and add diagnostic context as an internal comment -- all from a single script:
#!/bin/bash
# incident-response.sh — triggered by PagerDuty/Opsgenie webhook
# Create the incident request
ISSUE_KEY=$(atlassian-cli jsm request create \
--servicedesk-id 1 \
--request-type-id 12 \
--summary "$ALERT_SUMMARY" \
--description "$ALERT_DESCRIPTION" \
--format json | jq -r '.issue_key')
# Attach diagnostic info as internal note
atlassian-cli jsm request add-comment "$ISSUE_KEY" \
--body "Auto-generated. Source: $ALERT_SOURCE. Runbook: $RUNBOOK_URL"
echo "Created incident: $ISSUE_KEY"
Customer onboarding script
Automate the full onboarding flow -- create a customer, add them to an organization, and grant service desk access:
#!/bin/bash
# onboard-customer.sh
# Create the customer
atlassian-cli jsm customer create \
--email "$CUSTOMER_EMAIL" \
--display-name "$CUSTOMER_NAME"
# Add to organization
atlassian-cli jsm organization add-user 5 \
--account-id "$ACCOUNT_ID"
# Grant access to IT Help Desk and HR Service Desk
atlassian-cli jsm servicedesk add-customer 1 \
--account-id "$ACCOUNT_ID"
atlassian-cli jsm servicedesk add-customer 2 \
--account-id "$ACCOUNT_ID"
echo "Onboarded: $CUSTOMER_NAME ($CUSTOMER_EMAIL)"
FAQ
Can I automate Jira Service Management from the command line?
Yes. atlassian-cli provides a full JSM CLI with subcommands for service desks, requests, customers, queues, SLAs, approvals, organizations, request types, and knowledge base articles. It uses the same Atlassian API token as Jira and Confluence, so if you already have a profile configured, JSM works immediately.
Does the JSM CLI support SLA tracking and queue management?
Yes. The CLI includes jsm sla list and jsm sla get commands to inspect SLA metrics for any request, plus jsm queue list and jsm queue issues to query service desk queues and their contents. Output can be formatted as JSON, CSV, or table for integration into monitoring scripts and dashboards.
Is atlassian-cli free for JSM automation?
Yes. atlassian-cli is free and open source under the MIT license. It covers Jira, Confluence, Bitbucket, and JSM in a single Rust binary. Install via Homebrew (brew install omar16100/atlassian-cli/atlassian-cli), Cargo (cargo install atlassian-cli), or download pre-built binaries from GitHub Releases.