# Setup and Configure

Once you have installed SpecSync for Jira tool, you need to configure it. This means you have to create a SpecSync configuration file (specsync.json) that contains the Jira project connection details and other synchronization settings.

### Step 1: Define feature file sets

SpecSync has to be configured for every *feature file set*. **Feature file set is a folder that contains feature files that you want to synchronize as one batch.**

{% hint style="info" %}
*Feature file set* is a term introduced by SpecSync to denote the set of feature files that belong together in a platform independent way. Earlier we used the term *project folder*, but it was misleading, because people might call different things as "project" on .NET, Java and node.js platforms and also it could be confused with Jira projects.

If you use SpecSync with SpecFlow, the Visual Studio projects configured with SpecFlow are the feature file sets.

For other BDD tools, like Cucumber, usually the `features` folder(s) are set as feature file sets.
{% endhint %}

Each feature file set will have its own SpecSync configuration file (`specsync.json`). For projects with multiple feature file sets, you can use [hierarchical configuration files](/specsync/jira/features/general-features/hierarchical-configuration-files.md) as well.

It is up to you how you define your feature file sets. The following table contains a few usual setup variations.

| Platform & tool                               | Feature file set (location of specsync.json)                                                           |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| .NET solution with a single SpecFlow project  | The SpecFlow project folder (e.g. `MyProject.Specs`)                                                   |
| .NET solution with multiple SpecFlow projects | Each SpecFlow project folder (e.g. `MyProject.BackOffice.Specs` and `MyProject.ClientApp.Specs`)       |
| node.js app with Cucumber.js                  | The parent folder of the `features` folder (e.g. `/src/test/`)                                         |
| node.js app with multiple feature file sets   | The parent folders of the `features` folders (e.g. `/src/test/backoffice/` and `/src/test/clientapp/`) |
| Java app with Cucumber Java                   | The parent folder of the `features` folder (e.g. `/src/test/resources/`)                               |

You can also consider setting the features folder itself as a root of the feature file set (e.g. `/src/test/resources/features/` instead of `/src/test/resources/`).

{% hint style="info" %}
The feature file sets of your project and be changed later by moving the `specysnc.json` configuration file to a different location.
{% endhint %}

### Step 2: Initialize configuration file using the SpecSync init command

The easiest way to initialize the configuration file and configure the most important settings is to use the SpecSync `init` command. To use the command open a command window or bash shell and change the current directory to the root folder of the feature file set and invoke the following command.

{% tabs %}
{% tab title=".NET Core tool" %}

```
dotnet specsync init
```

{% endtab %}

{% tab title=".NET Console App" %}

```
SpecSync4Jira.cmd init
```

{% endtab %}

{% tab title="Native binaries" %}

```
<EXTRACTED-SPECSYNC-FOLDER>/SpecSync4Jira init
```

{% endtab %}
{% endtabs %}

The init command will ask a few questions in order the setup the connection to the Jira project, like the server URL and the authentication details. If you are unsure about what is exactly your Jira server URL, please check the [What is my Jira server URL](/specsync/jira/important-concepts/what-is-my-server-url.md) page. You can fine more information about the authentication options in the [Jira authentication options](/specsync/jira/features/general-features/server-authentication-options.md) page.

{% hint style="success" %}
It is recommended to let the init command test the authentication to the Jira project to make sure the connection is configured properly.
{% endhint %}

### Step 3: Review SpecSync features and extend configuration settings

The init command configures the settings that are enough for the first synchronization. SpecSync comes with useful default values for all settings, but you can still review the [SpecSync features](/specsync/jira/features.md) and extend the [configuration ](/specsync/jira/reference/configuration.md)if you need to. It is recommended to think about whether you would like to [exclude any scenarios from the synchronization](/specsync/jira/features/common-synchronization-features/excluding-scenarios-from-synchronization.md).

{% content-ref url="/pages/L3cvWVNUpXrIBt9GqwXb" %}
[Features](/specsync/jira/features.md)
{% endcontent-ref %}

{% content-ref url="/pages/As0iwTwtwwMJKOfZACmA" %}
[Configuration reference](/specsync/jira/reference/configuration.md)
{% endcontent-ref %}

### Step 4: Verify setup by synchronizing scenarios

When the SpecSync configuration file is complete, you can perform the first synchronization task and verify the results using the `push` command.

For larger feature file sets it is recommended to make the first synchronization only for a few selected scenarios tagged with a particular tag. You can even temporarily tag a few scenarios in order to test the synchronization. In our example we assume that the selected scenarios are tagged with `@specsync_test`.

To use the command open a command window or bash shell and change the current directory to the root folder of the feature file set and invoke the following command. For all command line option of the push command, please check the [command line reference](/specsync/jira/reference/command-line-reference/push-command.md).

{% tabs %}
{% tab title=".NET Core tool" %}

```
dotnet specsync push --filter @specsync_test
```

{% endtab %}

{% tab title=".NET Console App" %}

```
SpecSync4Jira.cmd push --filter @specsync_test
```

{% endtab %}

{% tab title="Native binaries" %}

```
<EXTRACTED-SPECSYNC-FOLDER>/SpecSync4Jira push --filter @specsync_test
```

{% endtab %}
{% endtabs %}

The synchronization should run successfully and SpecSync should create Test Cases in Jira for the selected scenarios and link to them using a tag.

In case of errors, you can retry the synchronization with an additional --verbose option that displays additional diagnostic information. If this does not help, please check the [Troubleshooting](/specsync/jira/contact/troubleshooting.md) page or contact [SpecSync Support](/specsync/jira/contact/specsync-support.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.specsolutions.eu/specsync/jira/installation/setup-and-configure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
