Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Variables API is available since the 2.8.0 Smart Issue Templates version.

Swagger open api macro
displayOperationIdfalse
methodsnone,get,put,post,delete,options,head,patch,trace
validator
defaultModelsExpandDepth1
url
token
defaultModelRenderingexample
filter
password
expandlist
showCommonExtensionsfalse
filename
operations
maxDisplayedTags
attachfalse

...

showExtensionsfalse

...

displayRequestDurationfalse
username
order
openapi: 3.0.3
info:
  title: SITDC REST API
  version: '1.0'
  description: |
    Path structure

    |Path type|Path structure                                       |Description          |
    |---------|-----------------------------------------------------|---------------------|
    |URI      |http://host:port/context/rest/smartissuetemplates/1.0|Root of the SITDC API|
tags:
  - name: Variable
    description: SITDC Variable
    externalDocs:
      description: Find out more about Variables
      url: https://appsdelivered.atlassian.net/wiki/spaces/SIT/pages/818937871/Variables

paths:
  /smartissuetemplates/1.0/variable:
    post:
      tags:
        - Variable
      summary: Add a new custom Variable
      description: Creates a custom Variable
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - name
                - defaultValue
              type: object
              properties:
                name:
                  type: string
                  example: testVar
                defaultValue:
                  type: string
                  example: Test variable
      responses:
        '201':
          description: Successfull operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                    example: false
                  errorMessages:
                    type: array
                    items:
                      type: string
                    example: ["Eror message"]

    put:
      tags:
        - Variable
      summary: Update a Variable
      description: Returns an updated Variable
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - id
                - name
                - defaultValue
              type: object
              properties:
                id:
                  type: integer
                name:
                  type: string
                  example: testVar
                defaultValue:
                  type: string
                  example: Test variable
      responses:
        '200':
          description: Successfull operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                    example: false
                  errorMessages:
                    type: array
                    items:
                      type: string
                    example: ["Eror message"]
        '404':
          description: Variable not found
          content:
            application/json:
              schema: 
                type: string
                description: Error message
            
  /smartissuetemplates/1.0/variable/{variableId}:
    delete:
      tags:
        - Variable
      summary: Delete a Variable by ID
      description: Deletes the Variable by ID
      parameters:
        - name: variableId
          in: path
          required: true
          schema:
            type: integer
      responses:
        '204':
          description: Successfull operation
        '404':
          description: Variable not found
          content:
            application/json:
              schema:
                type: string
                description: Error message
        '405':
          description: Variable in use
          content:
            application/json:
              schema:
                type: string
                description: Error message
  
  /smartissuetemplates/1.0/variable/global:
    get:
      tags:
        - Variable
      summary: Get all custom Variables
      description: Returns a list of custom Variables
      responses:
        '200':
          description: Successfull operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Variable'

  /smartissuetemplates/1.0/variable/system:
    get:
      tags:
        - Variable
      summary: Get all system Variables
      description: Returns a list of system Variables
      responses:
        '200':
          description: Successfull operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Variable'

components:
  schemas:
    Variable:
      required:
        - id
        - name
        - defaultValue
      type: object
      properties:
        id:
          type: integer
          example: 10
        name:
          type: string
          example: testVar
        defaultValue:
          type: string
          example: Test variable
        variableType:
          type: string
          enum:
            - TEXT
            - USER
          example: TEXT
        isDynamic:
          type: boolean
          example: false
        owner:
          $ref: '#/components/schemas/User'
        created:
          type: integer
          example: 1691699485337
        updateAuthor:
          $ref: '#/components/schemas/User'
        updateTime:
          type: integer
          example: 1691699485337
        variableScope:
          type: string
          enum:
            - GLOBAL
            - SYSTEM
            - HIERARCHY

    User:
      required:
        - username
      type: object
      properties:
        username:
          type: string
          example: testUser
        userKey:
          type: string
          example: JIRAUSER123
        displayName:
          type: string
          example: Test User
        admin:
          type: boolean
          example: false
        userEmail:
          type: string
          example: user@example.com
        avatarUrl:
          type: string