> ## Documentation Index
> Fetch the complete documentation index at: https://help.statisfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview a Jira config

> A dry run: tries a draft config on recent issues of one project and says which account each would go to, writing nothing. A project with no active rule in the draft is a 422. Calls Jira through Paragon: a 502 when Jira refuses or does not answer.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/integrations/jira/preview
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/integrations/jira/preview:
    post:
      tags:
        - integrations
      summary: Preview a Jira config
      description: >-
        A dry run: tries a draft config on recent issues of one project and says
        which account each would go to, writing nothing. A project with no
        active rule in the draft is a 422. Calls Jira through Paragon: a 502
        when Jira refuses or does not answer.
      operationId: integrations_jira_preview
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                config:
                  $ref: '#/components/schemas/JiraTenantConfig'
                  description: >-
                    The draft config to try, in the shape of GET /config.
                    Nothing is saved
                project_key:
                  description: >-
                    The project to draw sample issues from; the config needs an
                    active rule for it
                  pattern: ^[A-Z][A-Z0-9]{1,49}$
                  title: Project Key
                  type: string
                sample_size:
                  default: 10
                  description: How many recent issues to try
                  maximum: 25
                  minimum: 1
                  title: Sample Size
                  type: integer
              required:
                - config
                - project_key
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JiraPreview'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    JiraTenantConfig:
      description: >-
        Top-level tenant configuration for JIRA / JIRA Service Desk.


        Stored in IntegrationConfiguration.configuration under
        integration_key="jira".

        Service Desk projects are differentiated per-rule via
        ProjectRule.project_type

        rather than via a separate config row.


        Customer matching lives entirely on `ProjectRule.customer_resolution`.
        There

        is no tenant-level default — see ProjectRule's docstring for the
        rationale.
      properties:
        field_whitelist:
          $ref: '#/components/schemas/FieldWhitelist'
          description: >-
            Default account/task field whitelist. ProjectRules may override via
            their own field_whitelist. Note that customer_resolution is NOT
            mirrored here — that's project-only by design.
        project_keys:
          description: >-
            JIRA project keys to sync. May be empty — that represents an active
            config row with no projects yet (newly created) or after the user
            deletes the last project from the wizard. The runtime providers
            treat an empty list as 'nothing to sync', which is harmless.
          items:
            type: string
          title: Project Keys
          type: array
        project_rules:
          description: >-
            Per-rule list. A project_key may appear in multiple rules
            distinguished by issue_type_filter; runtime picks the most-specific
            match per issue. validate_jira_config enforces that every
            project_key in `project_keys` has at least one rule and that filters
            within a project do not overlap.
          items:
            $ref: '#/components/schemas/ProjectRule'
          title: Project Rules
          type: array
        site_base_url:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            The base URL issue links are built from, e.g.
            https://acme.atlassian.net. The wizard prefills this from JIRA's
            /serverInfo `baseUrl` but the admin can edit it — a tenant fronting
            JIRA with their own domain needs to say so. Required when
            sync_issue_link is on. It has to be configured because the issue
            payload never carries it: under Paragon's OAuth proxy
            `issue['self']` is the api.atlassian.com gateway URL, which is not
            browse-able.
          title: Site Base Url
        sync_issue_link:
          default: false
          description: >-
            When True, every synced task gets a 'JIRA Link' URL custom field
            pointing at the source issue (<site_base_url>/browse/<issue key>).
            Opt-in: enabling it provisions the field on save, so it never
            appears unasked on a tenant that does not want it.
            Account-projection rules (creates_task=False) are unaffected — the
            link is a task field only. Turning it back off stops new writes but
            is NOT a teardown: the custom field and every URL already written
            stay put, deliberately — deleting a populated field is destructive
            and belongs in Object Manager, where the admin can see what they are
            removing.
          title: Sync Issue Link
          type: boolean
      title: JiraTenantConfig
      type: object
    JiraPreview:
      properties:
        issues:
          description: Each sample issue with the account it would go to and the resolver
          items:
            additionalProperties: true
            type: object
          title: Issues
          type: array
        match_rate:
          description: The share of the sample issues that matched an account, 0 to 1
          title: Match Rate
          type: number
        warnings:
          items:
            type: string
          title: Warnings
          type: array
      required:
        - issues
        - match_rate
        - warnings
      title: JiraPreview
      type: object
    FieldWhitelist:
      description: >-
        Which JIRA custom fields propagate to Statisfy account/task records.


        `*_field_mappings` are the structured form used by the self-serve
        wizard:

        each entry pairs a JIRA field with the Statisfy custom field key it
        writes

        to. `account_fields` / `task_fields` are kept for backward compatibility

        with legacy configs that only list JIRA field names; the wizard derives

        them from the mappings on save.
      properties:
        account_field_mappings:
          description: Structured mappings of JIRA field -> Statisfy account custom field.
          items:
            $ref: '#/components/schemas/FieldMapping'
          title: Account Field Mappings
          type: array
        account_fields:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          description: >-
            Legacy: JIRA field names whitelisted for account-level fields. None
            = none.
          title: Account Fields
        auto_include_new_fields:
          default: true
          description: >-
            Legacy flag retained for backward compatibility; the self-serve
            wizard does not expose it.
          title: Auto Include New Fields
          type: boolean
        task_field_mappings:
          description: Structured mappings of JIRA field -> Statisfy task custom field.
          items:
            $ref: '#/components/schemas/FieldMapping'
          title: Task Field Mappings
          type: array
        task_fields:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          description: >-
            Legacy: JIRA field names whitelisted for task-level fields. None =
            none.
          title: Task Fields
      title: FieldWhitelist
      type: object
    ProjectRule:
      description: |-
        One handling rule for issues in a JIRA project.

        A single project_key may have multiple rules; runtime picks the rule
        whose `issue_type_filter.include` matches the issue's type, falling
        back to the project's catch-all rule (the rule with no filter, at
        most one per project_key).

        `creates_task=False` puts the rule in projection mode: matching
        issues do not become Statisfy tasks, instead their account-level
        field mappings are projected onto the resolved account. This
        replaces the previous `AccountFieldProjectionConfig`.
      properties:
        creates_task:
          default: true
          description: >-
            When False, matching issues do not create a Statisfy task. Combined
            with `field_whitelist.account_field_mappings`, this puts the rule in
            account-projection mode (the Skyflow Epic pattern).
          title: Creates Task
          type: boolean
        customer_resolution:
          description: >-
            Resolver chain for this rule, tried in order; first non-None match
            wins. Equivalent to a CompositeResolver. Must contain at least one
            entry — Pydantic enforces this so an admin can't accidentally save a
            rule with no way to identify customers.
          items:
            $ref: '#/components/schemas/AccountResolverConfig'
          minItems: 1
          title: Customer Resolution
          type: array
        field_whitelist:
          anyOf:
            - $ref: '#/components/schemas/FieldWhitelist'
            - type: 'null'
          default: null
          description: Optional account/task field whitelist for this rule.
        id:
          description: >-
            Stable client-side id used by the wizard UI as a React key and to
            address rules unambiguously across reorders. Auto-assigned at parse
            time for legacy configs that don't carry one.
          title: Id
          type: string
        is_active:
          default: true
          description: When False, the project rule is registered but not synced.
          title: Is Active
          type: boolean
        issue_type_filter:
          anyOf:
            - $ref: '#/components/schemas/IssueTypeFilter'
            - type: 'null'
          default: null
        project_key:
          description: JIRA project key, e.g. 'CUST', 'SUP'
          title: Project Key
          type: string
        project_type:
          default: software
          description: >-
            Detected from JIRA's projectTypeKey at discovery time. Drives which
            ActivitySource backfill emits and which nebula provider runs at sync
            time. 'service_desk' projects are routed through the JIRA Service
            Desk provider; everything else goes through the JIRA provider.
            Defaults to 'software' for back-compat with configs saved before
            this field existed.
          enum:
            - software
            - service_desk
            - business
          title: Project Type
          type: string
        support_multiple_customers:
          default: false
          description: >-
            When True, a single JIRA issue may resolve to multiple customers
            (used when the source field on the issue is a multi-select / array).
            The provider fans out account writes / task associations across
            every resolved account. Currently honored only by the
            JiraFieldAccountResolver path.
          title: Support Multiple Customers
          type: boolean
      required:
        - project_key
        - customer_resolution
      title: ProjectRule
      type: object
    FieldMapping:
      description: Pair a JIRA field with the Statisfy custom field it should write to.
      properties:
        jira_field:
          description: JIRA field id (e.g. 'customfield_10042') or display name.
          title: Jira Field
          type: string
        target_field_key:
          description: Statisfy custom field key the JIRA value writes to.
          title: Target Field Key
          type: string
      required:
        - jira_field
        - target_field_key
      title: FieldMapping
      type: object
    AccountResolverConfig:
      description: >-
        How to map record rows to internal Statisfy account IDs.


        Used by warehouse integrations (postgres/redshift/bigquery/snowflake)
        and

        JIRA. The schema is integration-agnostic; resolver types are dispatched
        by

        the integration's hydrator.
      properties:
        abbreviations:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          default: null
          description: >-
            Map of summary prefix abbreviation to canonical customer name
            (abbreviation_map)
          title: Abbreviations
        column:
          description: Source column in record containing the identifier
          title: Column
          type: string
        custom_field_key:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Custom field key for custom_field/custom_field_bulk resolver types
          title: Custom Field Key
        cutoff:
          anyOf:
            - type: number
            - type: 'null'
          default: null
          description: >-
            Fuzzy matching cutoff for account_name / parent_epic_summary /
            jira_field (name target) / payload_field (name target) resolvers
            (0.0-1.0). Default 0.5; tenants that need stricter matching (e.g.
            Eightfold's 0.9) set explicitly.
          title: Cutoff
        exclude_keywords:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          description: >-
            Parent-epic summaries equal (after strip) to any of these strings
            are skipped (parent_epic_summary). Exact-match semantics — list the
            full summary text, not a substring.
          title: Exclude Keywords
        field_to_parse:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Record key to parse for the abbreviation prefix (abbreviation_map;
            default 'summary')
          title: Field To Parse
        match_mode:
          anyOf:
            - enum:
                - exact
                - similar
              type: string
            - type: 'null'
          default: null
          description: >-
            How account_name and the name target of payload_field /
            rocketlane_field / jira_field / linear_field compare names. 'exact'
            matches the whole name, ignoring case. It compares the stored name
            as is, so a stored name with an edge space does not match. 'similar'
            or unset uses the fuzzy match with `cutoff`.
          title: Match Mode
        type:
          enum:
            - statisfy_account_id
            - crm_account_id
            - organization_id
            - email_domain
            - custom_field
            - custom_field_bulk
            - account_name
            - parent_epic_summary
            - abbreviation_map
            - jira_field
            - rocketlane_field
            - linear_field
            - payload_field
            - contact_email
          title: Type
          type: string
        value_transform:
          anyOf:
            - $ref: '#/components/schemas/ValueTransformConfig'
            - type: 'null'
          default: null
          description: >-
            Optional pre-lookup transforms on the extracted value. Honored by
            the jira_field resolver to express Milestone- and SproutsAI-style
            value shaping (prefix stripping, sentinel skipping, first-token
            extraction).
      required:
        - type
        - column
      title: AccountResolverConfig
      type: object
    IssueTypeFilter:
      description: Per-rule issue-type allow/deny list. None on a list means no filter.
      properties:
        exclude:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          description: Blacklist of issue type names. Applied after include if both set.
          title: Exclude
        include:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          description: Whitelist of issue type names. If set, only these are processed.
          title: Include
      title: IssueTypeFilter
      type: object
    ValueTransformConfig:
      description: >-
        Pre-lookup transforms applied to a raw field value before resolver
        matching.


        Captures shapes the legacy per-tenant providers expressed in code: skip

        sentinel values (Milestone's "Milestone" literal), strip prefixes

        (Milestone's "CUST-" prefix), split on a separator and take the first

        token (SproutsAI's `summary.split("|")[0]`, Milestone's space- or

        underscore-split). All fields are optional and applied left-to-right in

        the order listed below. If any step yields an empty string the resolver

        treats the field as missing.


        Currently honored by `JiraFieldAccountResolver`. Future resolvers can
        opt

        in by reading `value_transform` and applying `apply_value_transform()`.
      properties:
        regex_extract:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Python regex pattern; if it matches, replace the value with the
            first capture group. Applied last so it can post-process the output
            of the other transforms.
          title: Regex Extract
        skip_if_contains:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: If the raw value contains this substring, return None / skip lookup.
          title: Skip If Contains
        skip_if_equals:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            If the raw value equals this string (after strip), return None /
            skip lookup.
          title: Skip If Equals
        split_first_token:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Split the value on this separator and keep the first non-empty
            token. E.g. '|' for SproutsAI's 'Acme | INC-123' summary shape; ' '
            or '_' for Milestone.
          title: Split First Token
        strip_prefix:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: If the value starts with this prefix, remove it before lookup.
          title: Strip Prefix
      title: ValueTransformConfig
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.