Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
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
displayRequestDurationfalse
showExtensionsfalse
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: Scope
    description: SITDC Scope
    externalDocs:
      description: Find out more about Scopes
      url: https://appsdelivered.atlassian.net/wiki/spaces/SIT/pages/2490424/Scopes

paths:
  /smartissuetemplates/1.0/context:
    post:
      tags:
        - Scope
      summary: Add a new Scope
      description: Returns the created Scope
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - projectIds
                - issueTypeIds
                - groupNames
                - userNames
                - owners
              properties:
                name:
                  type: string
                  example: GLOBAL
                projectIds:
                  type: array
                  items:
                    type: integer
                  example: []
                issueTypeIds:
                  type: array
                  items:
                    type: integer
                  example: [-1]
                groupNames:
                  type: array
                  items:
                    type: string
                  example: []
                userNames:
                  type: array
                  items:
                    type: string
                  example: []
                owners:
                  type: array
                  items:
                    type: object
                    properties:
                      username:
                        type: string 
      responses:
        '201':
          description: Successfull operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Scope'
                description: Created Scope
        '400':
          description: Permission violation or 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:
        - Scope
      summary: Update a Scope
      description: Return the updated Scope
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - id
                - name
                - projectIds
                - issueTypeIds
                - groupNames
                - userNames
                - owners
              properties:
                id:
                  type: integer
                  example: 10
                name:
                  type: string
                  example: GLOBAL
                projectIds:
                  type: array
                  items:
                    type: integer
                  example: []
                issueTypeIds:
                  type: array
                  items:
                    type: integer
                  example: [-1]
                groupNames:
                  type: array
                  items:
                    type: string
                  example: []
                userNames:
                  type: array
                  items:
                    type: string
                  example: []
                owners:
                  type: array
                  items:
                    type: object
                    properties:
                      username:
                        type: string 
      responses:
        '200':
          description: Successfull operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Scope'
        '400':
          description: Permission violation or 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: Scope not found
          content:
            application/json:
              schema:
                type: string
                description: Error message

  /smartissuetemplates/1.0/context/{scopeId}:
    delete:
      tags:
        - Scope
      summary: Delete a Scope by ID
      description: Deltes the Scope by ID
      parameters:
        - name: scopeId
          in: path
          required: true
          schema:
            type: integer
      responses:
        '204':
          description: Successfull operation
        '403':
          description: Scope in use or Permission violation error
          content:
            application/json:
              schema:
                type: string
                description: Error message
        '404':
          description: Scope not found
          content:
            application/json:
              schema:
                type: string
                description: Error message

  /smartissuetemplates/1.0/context/pagination:
    post:
      tags:
        - Scope
      summary: Get the paginated scopes
      description: Returns a list of paginated, filtered and sorted scopes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
      responses:
        '200':
          description: Successfull operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScopePagination'

components:
  schemas:
    Template:
      required:
        - id
        - name
        - content
        - owners
        - scopeDto
        - availableFor
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
          example: Test Template
        content:
          type: string
          example: 'pid=10000&issuetype=10000&summary=&reporter=admin&dnd-dropzone=&duedate=&description=&assignee=-1&priority=3'
          description: Stringified content of Create Issue dialog
        owner:
          $ref: '#/components/schemas/User'
        availableFor:
          type: string
          example: SCOPE
          enum:
            - OWNER
            - SCOPE
        contentVersion:
          type: string
          example: V2
          enum:
            - V2
        description:
          type: string
          example: Just test template
        isPublic:
          type: boolean
          example: true
          description: true if availableFor equals SCOPE, otherwise false
        issueKey:
          type: string
          example: TP-1
        created:
          type: integer
          example: 1691696567217
          description: Integer of seconds since midnight, January 1, 1970
        updateAuthor:
          $ref: '#/components/schemas/User'
        updateTime:
          type: integer
          example: 1691696567217
        usages:
          type: integer
          example: 0
        isDefault:
          type: boolean
          example: false
        isFavorite:
          type: boolean
          example: false
        scopeDto:
          $ref: '#/components/schemas/Scope'
        owners:
          type: array
          items:
            $ref: '#/components/schemas/User'
        tagDtos:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        variableDtos:
          type: array
          items:
            $ref: '#/components/schemas/Variable'
        permissionDto:
          $ref: '#/components/schemas/Permission'
        projectId:
          type: string
          example: 10000
        issueTypeId:
          type: string
          example: 10010
        projectIds:
          type: array
          items:
            type: integer
        issueTypeIds:
          type: array
          items:
            type: integer
      
    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
          
          
    Scope:
      type: object
      properties:
        id:
          type: integer
          example: 1
        name:
          type: string
          example: GLOBAL
        owner:
          $ref: '#/components/schemas/User'
        isGlobalIssueType:
          type: boolean
          example: true
        isGlobalIssueProject:
          type: boolean
          example: true
        isGlobalIssueGroup:
          type: boolean
          example: true
        isGlobalIssueUser:
          type: boolean
          example: true
        projectIds:
          type: array
          items:
            type: integer
          example: []
        issueTypeIds:
          type: array
          items:
            type: integer
          example: [-1]
        permissionDto:
          $ref: '#/components/schemas/Permission'
        groupNames:
          type: array
          items:
            type: string
          example: []
        userNames:
          type: array
          items:
            type: string
          example: []
        owners:
          type: array
          items:
            $ref: '#/components/schemas/User'
        templateDtos:
          type: array
          items:
            $ref: '#/components/schemas/Template'
        countTemplates:
          type: integer
            
    Permission:
      type: object
      properties:
        canApply:
          type: boolean
          example: false
        canEdit:
          type: boolean
          example: false
        canDelete:
          type: boolean
          example: false
        canChangeOwner:
          type: boolean
          example: false
    
    
    Tag:
      required:
        - id
        - text
      type: object
      properties:
        id:
          type: integer
          example: 1
        text:
          type: string
          example: New Tag
        owner:
          $ref: '#/components/schemas/User'
        created:
          type: integer
          example: 1691694943294
        isNew:
          type: boolean
          example: false
        updateAuthor:
          $ref: '#/components/schemas/User'
        updated:
          type: integer
          example: 1691694943294
          
    
    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



    SearchRequest:
      required:
        - paginationDto
      type: object
      properties:
        paginationDto:
          $ref: '#/components/schemas/Pagination'
        filterDtos:
          type: array
          items:
            $ref: '#/components/schemas/Filter'

          
    Pagination:
      required:
        - limin
        - offset
        - column
        - order
      type: object
      properties:
        limit:
          type: integer
          example: 10
        offset:
          type: integer
          example: 20
        column:
          type: string
          enum:
            - name
            - usages
            - created
            - createdBy
            - changed
            - changedBy
            - scope
            - is_global
          example: name
        order:
          type: string
          enum:
            - ASC
            - DESC
        currentUser:
          type: string
          example: JIRAUSER123


    Filter:
      required:
        - column
        - fieldValues
      type: object
      properties:
        column:
          type: string
          enum:
            - PROJECT_ID
            - CAN_APPLY
            - NAME
            - TAG_ID
            - SCOPE_ID
            - AVAILABLE
            - OWNER_NAME
            - ISSUE_TYPE_ID
            - GROUP_ID
            - USER_ID
          example: NAME
        fieldValues:
          type: array
          items:
            type: string
          example: [Some template name]

    ScopePagination:
      type: object
      properties:
        scopes:
          type: array
          items:
            $ref: '#/components/schemas/Scope'
        numScopes:
          type: integer
          example: 10
        requestParam:
          $ref: "#/components/schemas/Pagination"
        filterDtos:
          type: array
          items:
            $ref: "#/components/schemas/Filter"

...