Troubleshooting your JIRA Integration

This page contains:

This guide will walk you through the basics of troubleshooting your JIRA Integration. During the first step, we're going to check to see whether the source of the errors is related to JIRA restrictions. Since Dradis adds Issues to your default JIRA project, if there are constraints on your default JIRA project, those can cause the "send to" process to fail with an error.

If switching to a new default project within JIRA doesn't change anything, it's time to use the Dradis console to check your JIRA connection. Yes, it is slightly convoluted to check this way but at the end, you should be left with an answer as far as what is the underlying cause of your error.

New default JIRA project

  1. Create a new default JIRA project

  2. Try to add a “Bug” item from Dradis into it

If you're able to send an Issue from Dradis to your new default JIRA project, it means there are some constraints on the other JIRA project, the one that’s failing. These constraints are all configured through JIRA and were the cause of your issues.

Test JIRA connection from the console

If a new default project didn't resolve things, it's time to test the connection from the Dradis console. It's a bit convoluted so stay with us!

First you have to use the Dradis UI to authenticate Dradis against JIRA. Then you have to “steal” the authentication details from the Dradis UI that are stored in session.

  1. Modify the /opt/dradispro/dradispro/shared/bundle/ruby/X.X.X/gems/dradis-jira-X.X.X/app/views/dradis/plugins/jira/issues/new.html.erb file and add the following at the top:

    <%= debug session[:jira_auth] %>

    Go to any project and send any issue to JIRA. The access_token and the access_key should show up at the top of the page.

  2. Fire up the rails console with the following commands as dradispro:

    $ cd /opt/dradispro/dradispro/current/
    $ RAILS_ENV=production bundle exec rails console
  3. Feed the access_token and access_key to the JIRA client:

    client ||= JIRA::Client.new(
      consumer_key:     Dradis::Plugins::Jira::Engine.settings.consumer_key,
      context_path:     '',
      private_key_file: Rails.root.join(Dradis::Plugins::Jira::Engine.settings.private_key_file),
      site:             Dradis::Plugins::Jira::Engine.settings.site
    )
    client.set_access_token(
      "access_token",
      "access_key"
    )

    In the set_access_token call, replace the first param with your access_token and the second param with your access_key that you got from step 1.

  4. Next, list the Issuetype IDs and Project IDs that you can use using the following commands:

    client.Issuetype.all.map { |i| i.id }
    => ["10001", "10002", "10004", "10005", "10003", "10000"]
    client.Project.all.map { |i| i.id }
    => ["10000"]

    Take note of these available IDs for the next step.

  5. Then finally, send an issue to JIRA using the following commands:

    result = {}
    result['fields'] = {
      'issuetype'   => { 'id' => 10001 },
      'description' => "description from console",
      'project'   => { 'id' => 10000 },
      'summary'     => "summary from console"
    }
    issue = client.Issue.build
    issue.save(result)

    For the issuetype > id, use any of the IDs that you got in the previous step. Do the same for the project > id, but use the Project list.

    If issue.save returns true, the connection is working and there’s something wrong in the Dradis web app. If it returns false, the API call didn’t work, and issue.errors should contain more details.

JIRA Data Center is using OAuth 2

If you're on JIRA Data Center, you might run into an issue with the application link requiring configuration using OAuth 2 credentials. Since JIRA in Dradis is using OAuth 1 for compatibility with JIRA Cloud, you'll need to create an OAuth 1 compatible application link in JIRA.

Fortunately, this is possible by creating an application link and choosing Atlassian Product as the link type. You can read more in the Atlassian documentation.

"Access Approved" message after allowing access to JIRA

After sending an issue to JIRA and allowing access to your JIRA instance, you might get the following message:

This means the Incoming Authentication in your JIRA Application Link is missing the Consumer Callback URL value.

Visit Jira settings > Products. Select Application links in the left menu. Edit the relevant application link and use the following value:

https://dradis.host/pro/addons/jira/authorizations/callback

Replace dradis.host with your actual Dradis host, save the changes, and you should be good to go!



As always, if you run into any issues or need additional help, please reach out to our support team and we'll help you get this sorted out!

Great job, you reached the end of the guide! Have you read all of them?

Streamline InfoSec Project Delivery

Learn practical tips to reduce the overhead that drags down security assessment delivery with this 5-day course. These proven, innovative, and straightforward techniques will optimize all areas of your next engagement including:

  • Scoping
  • Scheduling
  • Project Planning
  • Delivery
  • Intra-team Collaboration
  • Reporting and much more...

Your email is kept private. We don't do the spam thing.