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.
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.
Connect app scope required: READ
read:app-data:jira
array<string>
integer
integer
string
Returned if the request is successful.
A page of items.
1
2
3
4
5
6
7
8
9
10
11
12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asUser().requestJira(route`/rest/api/3/jql/function/computation`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
"isLast": true,
"maxResults": 100,
"startAt": 0,
"total": 1,
"values": [
{
"id": "cf75a1b0-4ac6-4bd8-8a50-29a465a96520",
"value": "issue in (TEST-1, TEST-2, TEST-3)",
"functionKey": "ari:cloud:ecosystem::extension/00000000-1111-2222-3333-4444444/111111-2222-3333-4444-55555/static/issuesWithText",
"field": "issue",
"operator": "in",
"functionName": "issuesWithText",
"arguments": [
"Test"
],
"created": "2023-10-14T05:25:20.000+0000",
"updated": "2023-10-14T05:25:20.000+0000",
"used": "2023-10-14T05:25:20.000+0000"
},
{
"id": "2a854f11-d0e1-4260-aea8-64a562a7062a",
"error": "Error message to be displayed to the user",
"functionKey": "ari:cloud:ecosystem::extension/00000000-1111-2222-3333-4444444/111111-2222-3333-4444-55555/static/issuesWithText",
"field": "issue",
"operator": "=",
"functionName": "issuesWithText",
"arguments": [
"10001"
],
"created": "2023-10-14T05:25:20.000+0000",
"updated": "2023-10-14T05:25:20.000+0000",
"used": "2023-10-14T05:25:20.000+0000"
}
]
}
Update the precomputation value of a function created by a Forge/Connect app.
Permissions required: An API for apps to update their own precomputations.
The new write: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.
Connect app scope required: READ
write:app-data:jira
array<JqlFunctionPrecomputationUpdateBean>
Returned if the request is successful.
any
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `{
"values": [
{
"id": "f2ef228b-367f-4c6b-bd9d-0d0e96b5bd7b",
"value": "issue in (TEST-1, TEST-2, TEST-3)"
},
{
"error": "Error message to be displayed to the user",
"id": "2a854f11-d0e1-4260-aea8-64a562a7062a"
}
]
}`;
const response = await api.asUser().requestJira(route`/rest/api/3/jql/function/computation`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Rate this page: