Evaluate Jira expression
POST
/rest/api/3/expression/eval
Jira expressions
Context variables
user
(User): The current user. Always available and equal to null
if the request is anonymous.app
(App): The Connect app that made the request. Available only for authenticated requests made by Connect Apps (read more here: Authentication for Connect apps).issue
(Issue): The current issue. Available only when the issue is provided in the request context object.project
(Project): The current project. Available only when the project is provided in the request context object.sprint
(Sprint): The current sprint. Available only when the sprint is provided in the request context object.board
(Board): The current board. Available only when the board is provided in the request context object.serviceDesk
(ServiceDesk): The current service desk. Available only when the service desk is provided in the request context object.customerRequest
(CustomerRequest): The current customer request. Available only when the customer request is provided in the request context object.user
: A user specified as an Atlassian account ID.issue
: An 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.Permission to access Jira Software is required to access Jira Software context variables (
board
and sprint
) or fields (for example, issue.sprint
).Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://jira.local:8080/jira/rest//rest/api/3/expression/eval' \
--header 'Content-Type: application/json' \
--data-raw '{
"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}"
}'
Response Response Example
200 - Success
{
"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."
]
}
}
}
}
Request
Query Params
expand
stringÂ
optional
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. Useful when designing and debugging your expressions.Body Params application/json
Responses
Modified at 2023-07-13 03:27:27