openapi: 3.1.0 info: title: Atlassian Admin Account Jira Expressions API description: The Atlassian Admin API provides programmatic access to manage Atlassian organizations, users, domains, policies, and events. It enables administrators to automate organization management tasks, integrate with identity providers, and ensure appropriate access to Atlassian products. version: 1.0.0 contact: name: Atlassian Developer url: https://developer.atlassian.com/cloud/admin/ license: name: Atlassian Developer Terms url: https://developer.atlassian.com/platform/marketplace/atlassian-developer-terms/ x-logo: url: https://wac-cdn.atlassian.com/assets/img/favicons/atlassian/favicon.png servers: - url: https://api.atlassian.com description: Atlassian Cloud API security: - bearerAuth: [] - oauth2: [] tags: - name: Jira Expressions paths: /rest/api/3/expression/analyse: post: deprecated: false description: 'Analyses and validates Jira expressions.

As an experimental feature, this operation can also attempt to type-check the expressions.

Learn more about Jira expressions in the [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/).

**[Permissions](#permissions) required**: None.' operationId: atlassianAnalyseexpression parameters: - description: "The check to perform:\n\n * `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are validated. For example, the expression's length.\n * `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors that would result in the expression failure at runtime are reported. For example, accessing properties that don't exist or passing the wrong number of arguments to functions. Also performs the syntax check.\n * `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each expression may execute." in: query name: check schema: default: syntax enum: - syntax - type - complexity type: string requestBody: content: application/json: example: contextVariables: listOfStrings: List record: '{ a: Number, b: String }' value: User expressions: - issues.map(issue => issue.properties['property_key']) schema: $ref: '#/components/schemas/JiraExpressionForAnalysis' description: The Jira expressions to analyse. required: true responses: '200': content: application/json: example: '{"results":[{"expression":"analysed expression","errors":[{"line":1,"column":4,"message":"!, -, typeof, (, IDENTIFIER, null, true, false, NUMBER, STRING, TEMPLATE_LITERAL, new, [ or { expected, > encountered.","type":"syntax"},{"message":"Jira expression is too long (1040), limit: 1000 characters","type":"other"},{"message":"Jira expression has too many nodes (150), limit: 100 leaves","type":"other"}],"valid":false},{"expression":"issues.map(i => {idAndKey: [i.id, i.key], summary: i.summary, comments: i.comments})","valid":true,"type":"List<{idAndKey: [Number, String], summary: String, comments: List}>","complexity":{"expensiveOperations":"N","variables":{"N":"issues"}}},{"expression":"issues.map(i => i.id > ''0'')","errors":[{"expression":"i.id > 0","message":"Can''t compare Number to String.","type":"type"}],"valid":false,"type":"TypeError"}]}' schema: $ref: '#/components/schemas/JiraExpressionsAnalysis' description: Returned if the request is successful. '400': content: application/json: schema: $ref: '#/components/schemas/ErrorCollection' description: 400 response '401': description: Returned if the authentication credentials are incorrect or missing. '404': content: application/json: schema: $ref: '#/components/schemas/ErrorCollection' description: 404 response security: - basicAuth: [] - OAuth2: - read:jira-work - read:jira-user - {} summary: Atlassian Analyse Jira Expression tags: - Jira Expressions x-atlassian-data-security-policy: - app-access-rule-exempt: true x-atlassian-oauth2-scopes: - scheme: OAuth2 scopes: - read:jira-work - read:jira-user state: Current - scheme: OAuth2 scopes: - read:field:jira - read:jira-expressions:jira state: Beta x-atlassian-connect-scope: READ /rest/api/3/expression/eval: post: deprecated: false description: 'Evaluates a Jira expression and returns its value.

This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible way. Consult the [Jira expressions documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details.

#### Context variables ####

The following context variables are available to Jira expressions evaluated by this resource. Their presence depends on various factors; usually you need to manually request them in the context object sent in the payload, but some of them are added automatically under certain conditions.

* `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The current user. Always available and equal to `null` if the request is anonymous.
* `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)).
* `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The current issue. Available only when the issue is provided in the request context object.
* `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A collection of issues matching a JQL query. Available only when JQL is provided in the request context object.
* `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): The current project. Available only when the project is provided in the request context object.
* `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): The current sprint. Available only when the sprint is provided in the request context object.
* `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The current board. Available only when the board is provided in the request context object.
* `serviceDesk` ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): The current service desk. Available only when the service desk is provided in the request context object.
* `customerRequest` ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): The current customer request. Available only when the customer request is provided in the request context object.

Also, custom context variables can be passed in the request with their types. Those variables can be accessed by key in the Jira expression. These variable types are available for use in a custom context:

* `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) specified as an Atlassian account ID.
* `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) specified by ID or key. All the fields of the issue object are available in the Jira expression.
* `json`: A JSON object containing custom content.
* `list`: A JSON list of `user`, `issue`, or `json` variable types.

This operation can be accessed anonymously.

**[Permissions](#permissions) required**: None. However, an expression may return different results for different users depending on their permissions. For example, different users may see different comments on the same issue.
Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`).' operationId: atlassianEvaluatejiraexpression parameters: - description: Use [expand](#expansion) to include additional information in the response. This parameter accepts `meta.complexity` that returns information about the expression complexity. For example, the number of expensive operations used by the expression and how close the expression is to reaching the [complexity limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing and debugging your expressions. in: query name: expand schema: type: string requestBody: content: application/json: example: context: board: 10100 custom: config: type: json value: userId: '10002' issuesList: - key: ACJIRA-1471 type: issue - id: 100001 type: issue myUser: accountId: '100001' type: user nullField: type: json customerRequest: 1450 issue: key: ACJIRA-1470 issues: jql: maxResults: 100 query: project = HSP startAt: 0 validation: strict project: key: ACJIRA serviceDesk: 10023 sprint: 10001 expression: '{ key: issue.key, type: issue.issueType.name, links: issue.links.map(link => link.linkedIssue.id), listCustomVariable: issuesList.includes(issue), customVariables: myUser.accountId == config.userId}' schema: $ref: '#/components/schemas/JiraExpressionEvalRequestBean' description: The Jira expression and the evaluation context. required: true responses: '200': content: application/json: example: '{"value":"The expression''s result. This value can be any JSON, not necessarily a String","meta":{"complexity":{"steps":{"value":1,"limit":10000},"expensiveOperations":{"value":3,"limit":10},"beans":{"value":0,"limit":1000},"primitiveValues":{"value":1,"limit":10000}},"issues":{"jql":{"startAt":0,"maxResults":1000,"count":140,"totalCount":140,"validationWarnings":["There is a problem with the JQL query."]}}}}' schema: $ref: '#/components/schemas/JiraExpressionResult' description: Returned if the evaluation results in a value. The result is a JSON primitive value, list, or object. '400': content: application/json: example: '{"errorMessages":["Evaluation failed: \"issue[''a'' + ''b'']\" - Unrecognized property of `issue`: \"ab\" (''a'' + ''b''). Available properties of type ''Issue'' are: ''assignee'', ''comments'', ''description'', ''id'', ''issueType'', ''key'', ''priority'', ''project'', ''properties'', ''reporter'', ''status'', ''summary''"],"errors":{}}' schema: $ref: '#/components/schemas/ErrorCollection' description: "Returned if:\n\n * the request is invalid, that is:\n \n * invalid data is provided, such as a request including issue ID and key.\n * the expression is invalid and can not be parsed.\n * evaluation fails at runtime. This may happen for various reasons. For example, accessing a property on a null object (such as the expression `issue.id` where `issue` is `null`). In this case an error message is provided." '401': description: Returned if the authentication credentials are incorrect or missing. '404': content: application/json: example: '{"errorMessages":["Issue does not exist or you do not have permission to see it."],"errors":{}}' schema: $ref: '#/components/schemas/ErrorCollection' description: Returned if any object provided in the request context is not found or the user does not have permission to view it. security: - basicAuth: [] - OAuth2: - read:jira-work - read:jira-user - {} summary: Atlassian Evaluate Jira Expression tags: - Jira Expressions x-atlassian-data-security-policy: - app-access-rule-exempt: false x-atlassian-oauth2-scopes: - scheme: OAuth2 scopes: - read:jira-work - read:jira-user state: Current - scheme: OAuth2 scopes: - read:jira-expressions:jira state: Beta x-atlassian-connect-scope: READ components: schemas: JsonContextVariable: description: A JSON object with custom content. properties: type: description: Type of custom context variable. type: string value: description: A JSON object containing custom content. type: object required: - type type: object UserContextVariable: description: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) specified as an Atlassian account ID. properties: accountId: description: The account ID of the user. type: string type: description: Type of custom context variable. type: string required: - accountId - type type: object JexpIssues: additionalProperties: false description: The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. properties: jql: allOf: - $ref: '#/components/schemas/JexpJqlIssues' description: The JQL query that specifies the set of issues available in the Jira expression. type: object IssueContextVariable: description: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) specified by ID or key. All the fields of the issue object are available in the Jira expression. properties: id: description: The issue ID. format: int64 type: integer key: description: The issue key. type: string type: description: Type of custom context variable. type: string required: - type type: object JiraExpressionsAnalysis: additionalProperties: false description: Details about the analysed Jira expression. properties: results: description: The results of Jira expressions analysis. items: $ref: '#/components/schemas/JiraExpressionAnalysis' type: array required: - results type: object JiraExpressionForAnalysis: additionalProperties: false description: Details of Jira expressions for analysis. properties: contextVariables: additionalProperties: description: Context variables and their types. The type checker assumes that common context variables, such as issue or project, are available in context and sets their type. Use this property to override the default types or provide details of new variables. type: string description: Context variables and their types. The type checker assumes that [common context variables](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables), such as `issue` or `project`, are available in context and sets their type. Use this property to override the default types or provide details of new variables. type: object expressions: description: The list of Jira expressions to analyse. example: issues.map(issue => issue.properties['property_key']) items: description: The list of Jira expressions to analyse. example: issues.map(issue => issue.properties['property_key']) type: string type: array required: - expressions type: object JiraExpressionComplexity: additionalProperties: false description: Details about the complexity of the analysed Jira expression. properties: expensiveOperations: description: "Information that can be used to determine how many [expensive operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) the evaluation of the expression will perform. This information may be a formula or number. For example:\n\n * `issues.map(i => i.comments)` performs as many expensive operations as there are issues on the issues list. So this parameter returns `N`, where `N` is the size of issue list.\n * `new Issue(10010).comments` gets comments for one issue, so its complexity is `2` (`1` to retrieve issue 10010 from the database plus `1` to get its comments)." type: string variables: additionalProperties: description: Variables used in the formula, mapped to the parts of the expression they refer to. type: string description: Variables used in the formula, mapped to the parts of the expression they refer to. type: object required: - expensiveOperations type: object JiraExpressionsComplexityBean: additionalProperties: false properties: beans: allOf: - $ref: '#/components/schemas/JiraExpressionsComplexityValueBean' description: The number of Jira REST API beans returned in the response. expensiveOperations: allOf: - $ref: '#/components/schemas/JiraExpressionsComplexityValueBean' description: The number of expensive operations executed while evaluating the expression. Expensive operations are those that load additional data, such as entity properties, comments, or custom fields. primitiveValues: allOf: - $ref: '#/components/schemas/JiraExpressionsComplexityValueBean' description: The number of primitive values returned in the response. steps: allOf: - $ref: '#/components/schemas/JiraExpressionsComplexityValueBean' description: The number of steps it took to evaluate the expression, where a step is a high-level operation performed by the expression. A step is an operation such as arithmetic, accessing a property, accessing a context variable, or calling a function. required: - beans - expensiveOperations - primitiveValues - steps type: object ErrorCollection: additionalProperties: false description: Error messages from an operation. properties: errorMessages: description: The list of error messages produced by this operation. For example, "input parameter 'key' must be provided" items: type: string type: array errors: additionalProperties: type: string description: 'The list of errors by parameter returned by the operation. For example,"projectKey": "Project keys must start with an uppercase letter, followed by one or more uppercase alphanumeric characters."' type: object status: format: int32 type: integer type: object JiraExpressionEvalContextBean: additionalProperties: false properties: board: description: The ID of the board that is available under the `board` variable when evaluating the expression. format: int64 type: integer custom: description: "Custom context variables and their types. These variable types are available for use in a custom context:\n\n * `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) specified as an Atlassian account ID.\n * `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) specified by ID or key. All the fields of the issue object are available in the Jira expression.\n * `json`: A JSON object containing custom content.\n * `list`: A JSON list of `user`, `issue`, or `json` variable types." items: $ref: '#/components/schemas/CustomContextVariable' type: array customerRequest: description: The ID of the customer request that is available under the `customerRequest` variable when evaluating the expression. This is the same as the ID of the underlying Jira issue, but the customer request context variable will have a different type. format: int64 type: integer issue: allOf: - $ref: '#/components/schemas/IdOrKeyBean' description: The issue that is available under the `issue` variable when evaluating the expression. issues: allOf: - $ref: '#/components/schemas/JexpIssues' description: The collection of issues that is available under the `issues` variable when evaluating the expression. project: allOf: - $ref: '#/components/schemas/IdOrKeyBean' description: The project that is available under the `project` variable when evaluating the expression. serviceDesk: description: The ID of the service desk that is available under the `serviceDesk` variable when evaluating the expression. format: int64 type: integer sprint: description: The ID of the sprint that is available under the `sprint` variable when evaluating the expression. format: int64 type: integer type: object JiraExpressionResult: additionalProperties: false description: The result of evaluating a Jira expression. properties: meta: allOf: - $ref: '#/components/schemas/JiraExpressionEvaluationMetaDataBean' description: Contains various characteristics of the performed expression evaluation. value: description: The value of the evaluated expression. It may be a primitive JSON value or a Jira REST API object. (Some expressions do not produce any meaningful results—for example, an expression that returns a lambda function—if that's the case a simple string representation is returned. These string representations should not be relied upon and may change without notice.) required: - value type: object JexpJqlIssues: additionalProperties: false description: The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. Not all issues returned by the JQL query are loaded, only those described by the `startAt` and `maxResults` properties. To determine whether it is necessary to iterate to ensure all the issues returned by the JQL query are evaluated, inspect `meta.issues.jql.count` in the response. properties: maxResults: description: The maximum number of issues to return from the JQL query. Inspect `meta.issues.jql.maxResults` in the response to ensure the maximum value has not been exceeded. format: int32 type: integer query: description: The JQL query. type: string startAt: description: The index of the first issue to return from the JQL query. format: int64 type: integer validation: default: strict description: Determines how to validate the JQL query and treat the validation results. enum: - strict - warn - none type: string type: object IssuesMetaBean: additionalProperties: false description: Meta data describing the `issues` context variable. properties: jql: $ref: '#/components/schemas/IssuesJqlMetaDataBean' type: object JiraExpressionValidationError: additionalProperties: false description: "Details about syntax and type errors. The error details apply to the entire expression, unless the object includes:\n\n * `line` and `column`\n * `expression`" properties: column: description: The text column in which the error occurred. format: int32 type: integer expression: description: The part of the expression in which the error occurred. type: string line: description: The text line in which the error occurred. format: int32 type: integer message: description: Details about the error. example: '!, -, typeof, (, IDENTIFIER, null, true, false, NUMBER, STRING, TEMPLATE_LITERAL, new, [ or { expected, > encountered.' type: string type: description: The error type. enum: - syntax - type - other type: string required: - message - type type: object CustomContextVariable: additionalProperties: false discriminator: mapping: issue: '#/components/schemas/IssueContextVariable' json: '#/components/schemas/JsonContextVariable' user: '#/components/schemas/UserContextVariable' propertyName: type oneOf: - $ref: '#/components/schemas/UserContextVariable' - $ref: '#/components/schemas/IssueContextVariable' - $ref: '#/components/schemas/JsonContextVariable' properties: type: description: Type of custom context variable. type: string required: - type type: object IssuesJqlMetaDataBean: additionalProperties: false description: The description of the page of issues loaded by the provided JQL query. properties: count: description: The number of issues that were loaded in this evaluation. format: int32 type: integer maxResults: description: The maximum number of issues that could be loaded in this evaluation. format: int32 type: integer startAt: description: The index of the first issue. format: int64 type: integer totalCount: description: The total number of issues the JQL returned. format: int64 type: integer validationWarnings: description: Any warnings related to the JQL query. Present only if the validation mode was set to `warn`. items: type: string type: array required: - count - maxResults - startAt - totalCount type: object JiraExpressionsComplexityValueBean: additionalProperties: false properties: limit: description: The maximum allowed complexity. The evaluation will fail if this value is exceeded. format: int32 type: integer value: description: The complexity value of the current expression. format: int32 type: integer required: - limit - value type: object JiraExpressionEvaluationMetaDataBean: additionalProperties: false properties: complexity: allOf: - $ref: '#/components/schemas/JiraExpressionsComplexityBean' description: Contains information about the expression complexity. For example, the number of steps it took to evaluate the expression. issues: allOf: - $ref: '#/components/schemas/IssuesMetaBean' description: Contains information about the `issues` variable in the context. For example, is the issues were loaded with JQL, information about the page will be included here. type: object JiraExpressionAnalysis: additionalProperties: false description: Details about the analysed Jira expression. properties: complexity: $ref: '#/components/schemas/JiraExpressionComplexity' errors: description: A list of validation errors. Not included if the expression is valid. items: $ref: '#/components/schemas/JiraExpressionValidationError' type: array expression: description: The analysed expression. type: string type: description: EXPERIMENTAL. The inferred type of the expression. type: string valid: description: Whether the expression is valid and the interpreter will evaluate it. Note that the expression may fail at runtime (for example, if it executes too many expensive operations). type: boolean required: - expression - valid type: object IdOrKeyBean: additionalProperties: false properties: id: description: The ID of the referenced item. format: int64 type: integer key: description: The key of the referenced item. type: string type: object JiraExpressionEvalRequestBean: additionalProperties: false properties: context: allOf: - $ref: '#/components/schemas/JiraExpressionEvalContextBean' description: The context in which the Jira expression is evaluated. expression: description: The Jira expression to evaluate. example: '{ key: issue.key, type: issue.issueType.name, links: issue.links.map(link => link.linkedIssue.id) }' type: string required: - expression type: object securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: API Key description: Use an Atlassian API key as a Bearer token. Create API keys at https://admin.atlassian.com. oauth2: type: oauth2 description: OAuth 2.0 authorization for Atlassian Cloud APIs. flows: authorizationCode: authorizationUrl: https://auth.atlassian.com/authorize tokenUrl: https://auth.atlassian.com/oauth/token scopes: read:org:admin: Read organization information. write:org:admin: Modify organization settings. read:user:admin: Read user information. write:user:admin: Modify user accounts. read:policy:admin: Read organization policies. write:policy:admin: Modify organization policies. read:event:admin: Read organization events. externalDocs: description: Atlassian Admin REST API Documentation url: https://developer.atlassian.com/cloud/admin/organization/rest/intro/