cURL Test


cURL Tool

Use cURL tool to check connection problems.

  • Tests should be executed on JIRA server.
  • You need access to the server (SSH, Remote Desktop, etc.).
  • If cURL is not available on the server please install it (http://curl.haxx.se/download.html) or ask your administrator to do that.




Test #1 - Check if JIRA can make a call to itself.


Execute cURL command like this:

curl -D- -u techUser:techUserPassword -X POST --data @test.json -H "Content-Type: application/json" https://my.jira.domain/rest/api/2/issue

Where:

  • techUser is a technical user set in Connection configuration
  • techUserPassword is a password of technical user (you may consider to clean .bash_history file afterward for security reasons, because password is passed in open text)
  • @test.json is a file (described below) that should be in the same directory where you run your cURL command
  • https://my.jira.domain is your JIRA baseURL 

Example test.json file:

{
    "fields": {
       "project":
       {
          "key""DEMO"
       },
       "summary""Issue created from REST.",
       "issuetype": {
          "name""Bug"
       }
   }
}

This is create issue message (see JIRA REST API for more). You may need to customize this message to correspond your projects, issue types, required fields on create issue screen.

Expected result:

HTTP/1.1 201 Created
Server: Apache-Coyote/1.1
X-AREQUESTID: 753x265x1
X-ASEN: SEN-L5760827
Set-Cookie: JSESSIONID=4E76FC9C1CF6DC2968E99F9FCC212C2B; Path=/; HttpOnly
X-Seraph-LoginReason: OK
Set-Cookie: atlassian.xsrf.token=B4ZU-DJPZ-5KS0-30HD|2c3e821cadc54f8863793fd9e0f7698797800b37|lin; Path=/
X-ASESSIONID: 1sxm55y
X-AUSERNAME: admin
Cache-Control: no-cache, no-store, no-transform
X-Content-Type-Options: nosniff
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 21 Sep 2015 10:33:25 GMT
 
{"id":"10300","key":"DEMO-17","self":"https://my.jira.domain/rest/api/2/issue/10300"}

That test's result means:

  • JIRA sees itself over the network using baseURL.
  • Technical User has permissions to create issues.
  • You know what fields are required to create given issue type in given project (may be helpful when defining Contract and Fields Mapping).


That result means the test has FAILED:

curl: (6) Could not resolve host: host-from-baseURL

  • Try to contact you administrator and ask him if it is possible to add your domain into hosts file.



Test #2 - Check if local JIRA can make a call to remote JIRA.

Execute similar cURL command like int Test#1 but

  • instead of local JIRA baseURL, provide remote JIRA URL,
  • instead of local JIRA Technical User, provide remote user with proper permissions. You may need to ask remote JIRA administrator to create a test user for you.

    Make sure you run the test from your JIRA server / host.

This test is only for Active (see Setup Connection URL & User) JIRA instance. The passive probably does not have access to the network.