@@ -339,4 +339,149 @@ export class JiraExpressions {
339
339
340
340
return this . client . sendRequest ( config , callback ) ;
341
341
}
342
+
343
+ /**
344
+ * Evaluates a Jira expression and returns its value. The difference between this and `eval` is that this endpoint
345
+ * uses the enhanced search API when evaluating JQL queries. This API is eventually consistent, unlike the strongly
346
+ * consistent `eval` API. This allows for better performance and scalability. In addition, this API's response for
347
+ * JQL evaluation is based on a scrolling view (backed by a `nextPageToken`) instead of a paginated view
348
+ * (backed by `startAt` and `totalCount`).
349
+ *
350
+ * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible
351
+ * way. Consult the [Jira expressions
352
+ * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details.
353
+ *
354
+ * #### Context variables
355
+ *
356
+ * The following context variables are available to Jira expressions evaluated by this resource. Their presence
357
+ * depends on various factors; usually you need to manually request them in the context object sent in the payload,
358
+ * but some of them are added automatically under certain conditions.
359
+ *
360
+ * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The
361
+ * current user. Always available and equal to `null` if the request is anonymous.
362
+ * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The
363
+ * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request.
364
+ * Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect
365
+ * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)).
366
+ * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The
367
+ * current issue. Available only when the issue is provided in the request context object.
368
+ * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of
369
+ * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A
370
+ * collection of issues matching a JQL query. Available only when JQL is provided in the request context object.
371
+ * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)):
372
+ * The current project. Available only when the project is provided in the request context object.
373
+ * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)):
374
+ * The current sprint. Available only when the sprint is provided in the request context object.
375
+ * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The
376
+ * current board. Available only when the board is provided in the request context object.
377
+ * - `serviceDesk`
378
+ * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)):
379
+ * The current service desk. Available only when the service desk is provided in the request context object.
380
+ * - `customerRequest`
381
+ * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)):
382
+ * The current customer request. Available only when the customer request is provided in the request context
383
+ * object.
384
+ *
385
+ * In addition, you can pass custom context variables along with their types. You can then access them from
386
+ * the Jira expression by key. You can use the following variables in a custom context:
387
+ *
388
+ * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)
389
+ * specified as an Atlassian account ID.
390
+ * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)
391
+ * specified by ID or key. All the fields of the issue object are available in the Jira expression.
392
+ * - `json`: A JSON object containing custom content.
393
+ * - `list`: A JSON list of `user`, `issue`, or `json` variable types.
394
+ *
395
+ * This operation can be accessed anonymously.
396
+ *
397
+ * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None.
398
+ * However, an expression may return different results for different users depending on their permissions. For
399
+ * example, different users may see different comments on the same issue. Permission to access Jira Software is
400
+ * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`).
401
+ */
402
+ async evaluateJiraExpressionUsingEnhancedSearch < T = Models . JExpEvaluateJiraExpressionResult > (
403
+ parameters : Parameters . EvaluateJiraExpressionUsingEnhancedSearch | undefined ,
404
+ callback : Callback < T > ,
405
+ ) : Promise < void > ;
406
+ /**
407
+ * Evaluates a Jira expression and returns its value. The difference between this and `eval` is that this endpoint
408
+ * uses the enhanced search API when evaluating JQL queries. This API is eventually consistent, unlike the strongly
409
+ * consistent `eval` API. This allows for better performance and scalability. In addition, this API's response for
410
+ * JQL evaluation is based on a scrolling view (backed by a `nextPageToken`) instead of a paginated view
411
+ * (backed by `startAt` and `totalCount`).
412
+ *
413
+ * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible
414
+ * way. Consult the [Jira expressions
415
+ * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details.
416
+ *
417
+ * #### Context variables
418
+ *
419
+ * The following context variables are available to Jira expressions evaluated by this resource. Their presence
420
+ * depends on various factors; usually you need to manually request them in the context object sent in the payload,
421
+ * but some of them are added automatically under certain conditions.
422
+ *
423
+ * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The
424
+ * current user. Always available and equal to `null` if the request is anonymous.
425
+ * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The
426
+ * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request.
427
+ * Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect
428
+ * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)).
429
+ * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The
430
+ * current issue. Available only when the issue is provided in the request context object.
431
+ * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of
432
+ * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A
433
+ * collection of issues matching a JQL query. Available only when JQL is provided in the request context object.
434
+ * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)):
435
+ * The current project. Available only when the project is provided in the request context object.
436
+ * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)):
437
+ * The current sprint. Available only when the sprint is provided in the request context object.
438
+ * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The
439
+ * current board. Available only when the board is provided in the request context object.
440
+ * - `serviceDesk`
441
+ * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)):
442
+ * The current service desk. Available only when the service desk is provided in the request context object.
443
+ * - `customerRequest`
444
+ * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)):
445
+ * The current customer request. Available only when the customer request is provided in the request context
446
+ * object.
447
+ *
448
+ * In addition, you can pass custom context variables along with their types. You can then access them from
449
+ * the Jira expression by key. You can use the following variables in a custom context:
450
+ *
451
+ * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)
452
+ * specified as an Atlassian account ID.
453
+ * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)
454
+ * specified by ID or key. All the fields of the issue object are available in the Jira expression.
455
+ * - `json`: A JSON object containing custom content.
456
+ * - `list`: A JSON list of `user`, `issue`, or `json` variable types.
457
+ *
458
+ * This operation can be accessed anonymously.
459
+ *
460
+ * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None.
461
+ * However, an expression may return different results for different users depending on their permissions. For
462
+ * example, different users may see different comments on the same issue. Permission to access Jira Software is
463
+ * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`).
464
+ */
465
+ async evaluateJiraExpressionUsingEnhancedSearch < T = Models . JExpEvaluateJiraExpressionResult > (
466
+ parameters ?: Parameters . EvaluateJiraExpressionUsingEnhancedSearch ,
467
+ callback ?: never ,
468
+ ) : Promise < T > ;
469
+ async evaluateJiraExpressionUsingEnhancedSearch < T = Models . JExpEvaluateJiraExpressionResult > (
470
+ parameters ?: Parameters . EvaluateJiraExpressionUsingEnhancedSearch ,
471
+ callback ?: Callback < T > ,
472
+ ) : Promise < void | T > {
473
+ const config : RequestConfig = {
474
+ url : '/rest/api/2/expression/evaluate' ,
475
+ method : 'POST' ,
476
+ params : {
477
+ expand : parameters ?. expand ,
478
+ } ,
479
+ data : {
480
+ expression : parameters ?. expression ,
481
+ context : parameters ?. context ,
482
+ } ,
483
+ } ;
484
+
485
+ return this . client . sendRequest ( config , callback ) ;
486
+ }
342
487
}
0 commit comments