Help Index

Youtrack Website

How does Testuff integrate with Youtrack?

Although Testuff is a hosted service it can automatically send every reported defect to your Youtrack account. You can run your manual tests with Testuff and continue to use Youtrack for bug tracking.

The integration is done by the desktop client. Therefore, it should also work if you host Youtrack on an internal server. Our server doesn’t need to access your bug tracker server and you don’t need to change anything in your security or firewall configuration to make it work.

How do I configure Youtrack with Testuff?

  1. In Testuff, go to Settings > Bug Tracker and click the Add bug tracker link.
  2. Choose Youtrack from the bug trackers combo box.
  3. Fill in the Youtrack server address in the URL field. This should be the Youtrack URL, omitting any file names that may appear after the last slash.
  4. Set the Default Project. Defects exported from Testuff projects that do not have a custom Youtrack project will be exported using this project name.
  5. You may click the Submit sample link to make sure Testuff can create bug reports in Youtrack. If all goes well the new bug report should be displayed.
  6. Don’t forget to click OK to save the settings.

Setting up automatic 2-way integration

Testuff supports an industry-unique option to automatically update your reported defects in Testuff, with any change made to them in your Youtrack. Here’s how to set it up:

Creating a webhook in Youtrack:

  1. In Youtrack, open Settings Dropdown menu and click on Workflows
  2. On Workflows screen click Create Workflow button and type in workflow title and name
  3. On Workflow screen add new On-change module
  4. Now copy this code into editor:
    • /*
       * This is a script to support 2-way integration between Youtrack and Testuff
       * 
       */
       
      const entities = require('@jetbrains/youtrack-scripting-api/entities');
      const http = require('@jetbrains/youtrack-scripting-api/http');
       
      /** You should update the  url with the webhook url from Testuff settings **/
      const url = 'https://serviceX.testuff.com/[CID]/webhook/youtrack/';
       
      exports.rule = entities.Issue.onChange({
        title: 'Testuff-hook-update',
        guard: function() {
          // TODO specify the conditions for executing the rule
          return true;
        },
        action: function(ctx) {
          const issue = ctx.issue;
          const [match, host, path] = /(https?:\/\/.*?)(\/.*)/.exec(url);
          const connection = new http.Connection(host);
          connection.addHeader('Content-Type', 'application/json');
       
          const json = {
            id: issue.id,
            url: issue.url,
            summary: issue.summary,
            description: issue.description,
            created: issue.created,
            updated: issue.updated,
            resolved: issue.resolved,
            project: issue.project.name,
            reporter: issue.reporter.visibleName,
            fields: [
              'Affected versions',
              'Due Date',
              'Fix versions',
              'Fixed in build',
              'Assignee',
              'Priority',
              'State',
              'Subsystem',
              'Type',
            ].reduce((fields, fieldName) => {
              var field = issue.fields[fieldName];
              if (field) {
                fields[fieldName] = field.visibleName || field.name || field.presentation;
              } else {
                fields[fieldName] = null;
              }
              return fields;
            }, {})
          };
          connection.postSync(path, [], JSON.stringify(json));
        },
        requirements: {
          // TODO: add requirements
        }
      });
      
    • Replace the URL https://serviceX.testuff.com/[CID]/webhook/youtrack/ with the URL you see in Testuff Settings->Bug trackers->Youtrack (under “Automatic 2-ways Integration URL”)
    • Click Save
  5. Go back to Workflows screen and tick the checkbox for the newly created workflow
  6. Add Workflow to your Project/s

You’re all set to report defects from Testuff to your Youtrack account, and get back automatic updates.

Can I associate a custom Youtrack project to a Testuff project?

Yep. If you wish to export defects from a certain Testuff project to a certain Youtrack project, follow the instructions below. Projects that do not have a custom Youtrack project set to them will use the default one from the general settings.

  1. Go to the home screen via the house icon at the top left.
  2. Click the Manage projects link and select a project by clicking on the Edit link next to it.
  3. Under the General tab, fill in the Youtrack project for this Testuff project.
  4. Click OK to save the settings.

Please contact us for any help integrating Testuff with your Youtrack.

Help Index