This resource represents JQL function's precomputations. Precomputation is a mapping between custom function call and JQL fragment returned by this function. Use it to get and update precomputations.

Hierarchy

  • CommonHttpService
    • JqlFunctionsAppsService

Constructors

  • Internal

    Create a new instance of the service.

    Parameters

    • getClientInstance: (() => CommonHttpClient)
        • (): CommonHttpClient
        • Returns CommonHttpClient

    Returns JqlFunctionsAppsService

Methods

  • Returns the list of a function's precomputations along with information about when they were created, updated, and last used. Each precomputation has a value - the JQL fragment to replace the custom function clause with.

    Permissions required: This API is only accessible to apps and apps can only inspect their own functions.

    The new read:app-data:jira OAuth scope is 100% optional now, and not using it won't break your app. However, we recommend adding it to your app's scope list because we will eventually make it mandatory.

    Parameters

    • params: {
          functionKey?: string[];
          maxResults?: number;
          orderBy?: string;
          startAt?: number;
      } = {}
      • OptionalfunctionKey?: string[]

        The function key in format:

        • Forge: ari:cloud:ecosystem::extension/[App ID]/[Environment ID]/static/[Function key from manifest]
        • Connect: [App key]__[Module key]
      • OptionalmaxResults?: number

        The maximum number of items to return per page.

      • OptionalorderBy?: string

        Order the results by a field:

        • functionKey Sorts by the functionKey.
        • used Sorts by the used timestamp.
        • created Sorts by the created timestamp.
        • updated Sorts by the updated timestamp.
      • OptionalstartAt?: number

        The index of the first item to return in a page of results (page offset).

    Returns Promise<PageBean2JqlFunctionPrecomputationBean>

    Returned if the request is successful.

    example:

    {
    "isLast": true,
    "maxResults": 100,
    "startAt": 0,
    "total": 1,
    "values": [
    {
    "arguments": [
    "Test"
    ],
    "created": "2023-10-14T05:25:20.000+0000",
    "field": "issue",
    "functionKey": "ari:cloud:ecosystem::extension/00000000-1111-2222-3333-4444444/111111-2222-3333-4444-55555/static/issuesWithText",
    "functionName": "issuesWithText",
    "id": "cf75a1b0-4ac6-4bd8-8a50-29a465a96520",
    "operator": "in",
    "updated": "2023-10-14T05:25:20.000+0000",
    "used": "2023-10-14T05:25:20.000+0000",
    "value": "issue in (TEST-1, TEST-2, TEST-3)"
    },
    {
    "arguments": [
    "10001"
    ],
    "created": "2023-10-14T05:25:20.000+0000",
    "error": "Error message to be displayed to the user",
    "field": "issue",
    "functionKey": "ari:cloud:ecosystem::extension/00000000-1111-2222-3333-4444444/111111-2222-3333-4444-55555/static/issuesWithText",
    "functionName": "issuesWithText",
    "id": "2a854f11-d0e1-4260-aea8-64a562a7062a",
    "operator": "=",
    "updated": "2023-10-14T05:25:20.000+0000",
    "used": "2023-10-14T05:25:20.000+0000"
    }
    ]
    }

    GET /rest/api/3/jql/function/computation @scopes-current @scopes-beta read:app-data:jira

  • Returns function precomputations by IDs, along with information about when they were created, updated, and last used. Each precomputation has a value - the JQL fragment to replace the custom function clause with.

    Permissions required: This API is only accessible to apps and apps can only inspect their own functions.

    The new read:app-data:jira OAuth scope is 100% optional now, and not using it won't break your app. However, we recommend adding it to your app's scope list because we will eventually make it mandatory.

    Parameters

    • params: {
          jqlFunctionPrecomputationGetByIdRequest: JqlFunctionPrecomputationGetByIdRequest;
          orderBy?: string;
      }
      • jqlFunctionPrecomputationGetByIdRequest: JqlFunctionPrecomputationGetByIdRequest
      • OptionalorderBy?: string

        Order the results by a field:

        • functionKey Sorts by the functionKey.
        • used Sorts by the used timestamp.
        • created Sorts by the created timestamp.
        • updated Sorts by the updated timestamp.

    Returns Promise<JqlFunctionPrecomputationGetByIdResponse>

    Returned if the request is successful.

    example:

    {
    "notFoundPrecomputationIDs": [
    "cce1ef75-d566-40f8-a1a8-a9067f70ad69",
    "82583f5d-0a44-454b-a1f5-4e06838fbf80"
    ],
    "precomputations": [
    {
    "arguments": [
    "Test"
    ],
    "created": "2023-10-14T05:25:20.000+0000",
    "field": "issue",
    "functionKey": "ari:cloud:ecosystem::extension/00000000-1111-2222-3333-4444444/111111-2222-3333-4444-55555/static/issuesWithText",
    "functionName": "issuesWithText",
    "id": "cf75a1b0-4ac6-4bd8-8a50-29a465a96520",
    "operator": "in",
    "updated": "2023-10-14T05:25:20.000+0000",
    "used": "2023-10-14T05:25:20.000+0000",
    "value": "issue in (TEST-1, TEST-2, TEST-3)"
    },
    {
    "arguments": [
    "10001"
    ],
    "created": "2023-10-14T05:25:20.000+0000",
    "error": "Error message to be displayed to the user",
    "field": "issue",
    "functionKey": "ari:cloud:ecosystem::extension/00000000-1111-2222-3333-4444444/111111-2222-3333-4444-55555/static/issuesWithText",
    "functionName": "issuesWithText",
    "id": "2a854f11-d0e1-4260-aea8-64a562a7062a",
    "operator": "=",
    "updated": "2023-10-14T05:25:20.000+0000",
    "used": "2023-10-14T05:25:20.000+0000"
    }
    ]
    }

    POST /rest/api/3/jql/function/computation/search @scopes-current @scopes-beta read:app-data:jira

  • Method to initialize the class. Normally used to set up validation rules.

    Returns void