Create a support zip using the REST API in Server applications

Still need help?

The Atlassian Community is here for you.

Ask the community

Support zips help Atlassian Support understand how your application has been configured and troubleshoot your problem.  The most common way to generate a support zip is from the administration console of your application, however you can also use the REST API to create the zip.

If you're running a Data Center application (in a cluster), see Create a support zip using the REST API in Data Center applications as the process is a little different.

The option to use REST to generate a support zip is only available for applications running Atlassian Troubleshooting and Support Tools add-on 1.9.1 or later.  Some options on this page require version 1.11.0 or later.

You can upgrade this add-on at any time, head to Manage Add-ons and search for Atlassian Troubleshooting and Support Tools (if you're running an older version, it may be called Atlassian Support Tools). 

REST API reference

The following REST endpoints are available:

REST API Description For

/rest/troubleshooting/latest/support-zip/local

Create a support zip  Server
/rest/troubleshooting/latest/support-zip/status/task Get the status of all recent zip creation tasks Server
/rest/troubleshooting/latest/support-zip/status/task/<taskId> Get the status of a specific zip creation task Server and Data Center 

/rest/troubleshooting/latest/support-zip/download/<filename>

Download support zip file Server and Data Center
/rest/troubleshooting/latest/support-zip/cluster Create a support zip on multiple nodes of the cluster Data Center
/rest/troubleshooting/latest/support-zip/status/cluster/<clusterTaskId> Get the status of the zip creation tasks for the cluster Data Center

This page contains examples of using this REST API in Server applications using curl and Windows PowerShell.  You can use the scripting language of your choice. 

See Create a support zip using the REST API in Data Center applications for Data Center specific examples. 

Generate a support zip

You'll need System Administrator permissions to generate the support zip. 

To generate a support zip from the command line: 

curl -u <username>:<password> -X POST http://<app-url.example.com:8080>/rest/troubleshooting/latest/support-zip/local
To generate a support zip using Windows PowerShell...

This step requires Invoke-WebRequest. This was introduced in PowerShell v3.0, so is available by default in Windows 8 and from Windows Server 2012. 

# Specify your username, password and Base URL (including a context path if one is being used) below
$user = '<username>'
$pass = '<password>'
$baseurl = 'http://<app-url.example.com:8080>'

# no need to change anything below this line
$pair = "$($user):$($pass)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"

$headers = @{}
$headers.Add("Authorization", $basicAuthValue)
$headers.Add("X-Atlassian-Token", "no-check")

Invoke-WebRequest -Method POST -Uri "$baseurl/rest/troubleshooting/latest/support-zip/local" -UseBasicParsing -Headers $headers

This returns the Task ID and progress information, for example:

{
   "taskId":"9e7b7012-0730-427b-bf85-607d15abadb5",
   "progressPercentage":0, 
   "progressMessage":"Processing"
}
Output when using Windows PowerShell...
StatusCode        : 200
StatusDescription : OK
Content           : {"taskId":"9e7b7012-0730-427b-bf85-607d15abadb5","progressPercentage":0,"progressMessage":""}

Check the progress of the task

Often it can take some time to generate the zip, especially in large sites. To check the progress of the task:

curl -u <username>:<password> http://<app-url.example.com:8080>/rest/troubleshooting/latest/support-zip/status/task/<taskId>

The task ID in this example would be 9e7b7012-0730-427b-bf85-607d15abadb5

To generate a support zip using Windows PowerShell...
# Specify your username, password and Base URL (including a context path if one is being used) below
$user = '<username>'
$pass = '<password>'
$baseurl = 'http://<app-url.example.com:8080>'
$taskid = '<taskid>'

# no need to change anything below this line
$pair = "$($user):$($pass)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"

$headers = @{}
$headers.Add("Authorization", $basicAuthValue)
$headers.Add("X-Atlassian-Token", "no-check")

(Invoke-WebRequest -Uri "$baseurl/rest/troubleshooting/latest/support-zip/status/task/$taskid" -UseBasicParsing -Headers $headers).Content

This returns the current progress. In this example, the zip is complete and ready to be transferred from the appropriate home directory. 

{
"taskId":"9e7b7012-0730-427b-bf85-607d15abadb5",
"progressPercentage":100,
"progressMessage":"Your support ZIP can be found in your home directory at: C:\\<home-directory\\export\\JIRA_support_node1_2018-04-03-11-37-37.zip or you can download a copy.",
"fileName":"JIRA_support_node1_2018-04-03-11-37-37.zip"
}


Check all recently requested support zips

To check the progress of all support zips recently requested on that node: 

curl -u <username>:<password> http://<app-url.example.com:8080>/rest/troubleshooting/latest/support-zip/status/task
To generate a support zip using Windows PowerShell...
# Specify your username, password and Base URL (including a context path if one is being used) below
$user = '<username>'
$pass = '<password>'
$baseurl = 'http://<app-url.example.com:8080>'
# To see all, just set $taskid to empty string
$taskid= ''

# no need to change anything below this line
$pair = "$($user):$($pass)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"

$headers = @{}
$headers.Add("Authorization", $basicAuthValue)
$headers.Add("X-Atlassian-Token", "no-check")

(Invoke-WebRequest -Uri "$baseurl/rest/troubleshooting/latest/support-zip/status/task/$taskid" -UseBasicParsing -Headers $headers).Content

This returns details of any support zips being generated, or which were generated in the last 2 hours minutes, for example:

[{
    "taskId": "36b64a49-13d2-45b6-92d5-554577649906",
    "progressPercentage": 100,
    "progressMessage": "Your support ZIP can be found in your home directory at: /<home-directory>/export/JIRA_support_node1_2018-04-03-11-37-37.zip or you can download a copy.",
    "fileName": "JIRA_support_2018-04-03-11-37-37.zip"
}, {
    "taskId": "34d7cdce-12f7-4b46-b287-5f5040f2362b",
    "progressPercentage": 100,
    "progressMessage": "Your support ZIP can be found in your home directory at: /<home-directory>/export/JIRA_support_2018-04-03-11-24-58.zip or you can download a copy.",
    "fileName": "JIRA_support_2018-04-03-11-24-58.zip"
}]

We can only display recently requested support zips from the current session. If you restart your application, the REST API won't return details of any support zips requested before a restart. 

Generate a support zip with particular parameters

This option is only available with Atlassian Troubleshooting and Support Tools version 1.11.0 or later. 

When you generate a support zip via the admin console, you're able to select which items to include, and whether to limit file sizes. This is also possible when generating the zip using the REST API.

For example, if you only wanted the log files and health check results, and didn't want to limit file sizes you could use the following:

curl -s -X POST -H 'Content-Type: application/json' -u <username>:<password> http://<app-url.example.com:8080>/rest/troubleshooting/latest/support-zip/local -d '{"items":["APPLICATION_LOGS", "TOMCAT_LOGS", "HEALTHCHECKS"], "limitFileSizes": false}'

(warning) Including the Content-Type header allows you to include a json payload, which is used to specify particular nodes or items to include in the zip. 

Here's a list of  items you can include in your support zip, and what they're called in the UI, for reference. See  Create a Support Zip for a full description of each item. 
Description in UI Field for API Included by default
Authentication Configuration
AUTH_CONFIG
Yes
Application Configuration Files
APPLICATION_CONFIG
Yes
Application properties
APPLICATION_PROPERTIES
Yes
Application Customization
CONF_CUSTOMISATIONS
Yes (Confluence)
Health check results
HEALTHCHECKS
Yes
Application Logs
APPLICATION_LOGS
Yes
Cache Configuration
CACHE_CONFIG
Yes
Fisheye/Crucible.out log
FECRU_OUT
Yes (Fisheye/Crucible)
Fisheye/Crucible plugin configuration
FECRU_PLUGIN_STATE
Yes (Fisheye/Crucible)
Locally modified files
MODZ
Yes (Fisheye/Crucible)
Fisheye/Crucible plugin configuration files
PLUGIN_CONFIG
Yes (Fisheye/Crucible)
Thread dumps
THREAD_DUMP
No
Tomcat Configuration Files
TOMCAT_CONFIG
Yes
Tomcat Logs
TOMCAT_LOGS
Yes
Synchrony configuration
SYNCHRONY_CONFIG
Yes (Confluence)
Limit file sizes
limitFileSizes
Defaults to true

Download the support zip

This option is available with Atlassian Troubleshooting and Support Tools version 1.11.0 or later. 

The support zip will be saved to a location in your home directory. If you're not able to easily access that directory, or you want to automate the process, you can use the REST API to download it as follows:

curl -u <username>:<password> http://<app-url.example.com:8080>/rest/troubleshooting/latest/support-zip/download/JIRA_support_2018-04-03-11-24-58.zip -o support.zip

Troubleshooting

  • You need System Administrator permissions to generate the support zip. The request will fail with a permission error if you don't have adequate permissions. 
  • If you see a 404 error, make sure Jira is running, and has version 1.9.1 or later of the Atlassian Troubleshooting and Support Tools add-on.  You can update this plugin at any time, see Updating add-ons for more information. 
  • If nothing is returned in your terminal, then it is likely that you need to provide the URL of the specific node, not your application's base url (load balancer URL). 
  • If an ' XSRF check failed'  error is returned, you can add the X-Atlassian-Token header to each request, setting the value to no-check. Adding this header to a request bypasses the server-side XSRF check and allows the request to be fulfilled.  For example:

    curl -u <username>:<password> -X POST http://<app-node1.example.com:8080>/rest/troubleshooting/latest/support-zip/local -H "X-Atlassian-Token: no-check"


Last modified on Jun 14, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.