-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented new function evaluateJiraExpressionUsingEnhancedSearch()
- Loading branch information
Showing
15 changed files
with
301 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export interface IssueContextVariable { | ||
/** The issue ID. */ | ||
id?: number; | ||
/** The issue key. */ | ||
key?: string; | ||
/** Type of custom context variable. */ | ||
type: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** The description of the page of issues loaded by the provided JQL query. */ | ||
export interface JExpEvaluateIssuesJqlMetaData { | ||
/** Next Page token for the next page of issues. */ | ||
nextPageToken?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { JExpEvaluateIssuesJqlMetaData } from './jExpEvaluateIssuesJqlMetaData'; | ||
|
||
/** Meta data describing the `issues` context variable. */ | ||
export interface JExpEvaluateIssuesMeta { | ||
/** | ||
* The description of the page of issues loaded by the provided JQL query. | ||
* This bean will be replacing IssuesJqlMetaDataBean bean as part of new `evaluate` endpoint | ||
*/ | ||
jql?: JExpEvaluateIssuesJqlMetaData; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { JExpEvaluateMetaData } from './jExpEvaluateMetaData'; | ||
|
||
/** The result of evaluating a Jira expression. */ | ||
export interface JExpEvaluateJiraExpressionResult { | ||
/** | ||
* 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.) | ||
*/ | ||
value: any; | ||
meta?: JExpEvaluateMetaData; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { JExpEvaluateIssuesMeta } from './jExpEvaluateIssuesMeta'; | ||
import { JiraExpressionsComplexity } from './jiraExpressionsComplexity'; | ||
|
||
export interface JExpEvaluateMetaData { | ||
/** | ||
* Contains information about the expression complexity. For example, the number of steps it took to | ||
* evaluate the expression. | ||
*/ | ||
complexity?: JiraExpressionsComplexity; | ||
/** | ||
* 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. | ||
*/ | ||
issues?: JExpEvaluateIssuesMeta; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { JexpEvaluateCtxJqlIssues } from './jexpEvaluateCtxJqlIssues'; | ||
|
||
/** The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. */ | ||
export interface JexpEvaluateCtxIssues { | ||
jql?: JexpEvaluateCtxJqlIssues; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* The JQL query that specifies the set of issues available in the Jira expression. | ||
*/ | ||
export interface JexpEvaluateCtxJqlIssues { | ||
/** | ||
* 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. | ||
*/ | ||
maxResults?: number; | ||
/** | ||
* The token for a page to fetch that is not the first page. The first page has a `nextPageToken` of `null`. | ||
* Use the `nextPageToken` to fetch the next page of issues. | ||
*/ | ||
nextPageToken?: string; | ||
/** The JQL query, required to be bounded. Additionally, `orderBy` clause can contain a maximum of 7 fields */ | ||
query?: string; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/version3/models/jiraExpressionEvalUsingEnhancedSearchRequest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { JiraExpressionEvaluateContext } from './jiraExpressionEvaluateContext'; | ||
|
||
export interface JiraExpressionEvalUsingEnhancedSearchRequest { | ||
/** The Jira expression to evaluate. */ | ||
expression: string; | ||
/** The context in which the Jira expression is evaluated. */ | ||
context?: JiraExpressionEvaluateContext; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { IssueContextVariable } from './issueContextVariable'; | ||
import { JsonContextVariable } from './jsonContextVariable'; | ||
import { UserContextVariable } from './userContextVariable'; | ||
import { IdOrKey } from './idOrKey'; | ||
import { JexpEvaluateCtxIssues } from './jexpEvaluateCtxIssues'; | ||
|
||
export interface JiraExpressionEvaluateContext { | ||
issue?: IdOrKey; | ||
issues?: JexpEvaluateCtxIssues; | ||
project?: IdOrKey; | ||
/** The ID of the sprint that is available under the `sprint` variable when evaluating the expression. */ | ||
sprint?: number; | ||
/** The ID of the board that is available under the `board` variable when evaluating the expression. */ | ||
board?: number; | ||
/** The ID of the service desk that is available under the `serviceDesk` variable when evaluating the expression. */ | ||
serviceDesk?: number; | ||
/** | ||
* 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. | ||
*/ | ||
customerRequest?: number; | ||
/** | ||
* Custom context variables and their types. 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. | ||
*/ | ||
custom?: ( | ||
| UserContextVariable | ||
| IssueContextVariable | ||
| JsonContextVariable | ||
)[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface JsonContextVariable { | ||
/** Type of custom context variable. */ | ||
type: string; | ||
/** A JSON object containing custom content. */ | ||
value?: any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface UserContextVariable { | ||
/** The account ID of the user. */ | ||
accountId: string; | ||
/** Type of custom context variable. */ | ||
type: string; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/version3/parameters/evaluateJiraExpressionUsingEnhancedSearch.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { JiraExpressionEvalUsingEnhancedSearchRequest } from '../models'; | ||
|
||
export interface EvaluateJiraExpressionUsingEnhancedSearch extends JiraExpressionEvalUsingEnhancedSearchRequest { | ||
/** | ||
* Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#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. | ||
*/ | ||
expand?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters