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.
read:app-data:jira
Connect app scope required: READ
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": [
{
"arguments": [
"Test"
],
"created": "2023-10-14T05:25:20.000+0000",
"field": "issue",
"functionKey": "ari:cloud:ecosystem::extension/00000000-1111-2222-3333-4444444/111111-2222-3333-4444-55555/static/issuesWithText",
"functionName": "issuesWithText",
"id": "cf75a1b0-4ac6-4bd8-8a50-29a465a96520",
"operator": "in",
"updated": "2023-10-14T05:25:20.000+0000",
"used": "2023-10-14T05:25:20.000+0000",
"value": "issue in (TEST-1, TEST-2, TEST-3)"
},
{
"arguments": [
"10001"
],
"created": "2023-10-14T05:25:20.000+0000",
"error": "Error message to be displayed to the user",
"field": "issue",
"functionKey": "ari:cloud:ecosystem::extension/00000000-1111-2222-3333-4444444/111111-2222-3333-4444-55555/static/issuesWithText",
"functionName": "issuesWithText",
"id": "2a854f11-d0e1-4260-aea8-64a562a7062a",
"operator": "=",
"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.
write:app-data:jira
Connect app scope required: READ
boolean
array<JqlFunctionPrecomputationUpdateBean>
200 response
Result of updating JQL Function precomputations.
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());
1
2
3
4
5
{
"notFoundPrecomputationIDs": [
"<string>"
]
}
Returns function precomputations by IDs, 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.
read:app-data:jira
Connect app scope required: READ
string
array<string>
Returned if the request is successful.
Get precomputations by ID response.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `{
"precomputationIDs": [
"f2ef228b-367f-4c6b-bd9d-0d0e96b5bd7b",
"2a854f11-d0e1-4260-aea8-64a562a7062a"
]
}`;
const response = await api.asUser().requestJira(route`/rest/api/3/jql/function/computation/search`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
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
{
"notFoundPrecomputationIDs": [
"cce1ef75-d566-40f8-a1a8-a9067f70ad69",
"82583f5d-0a44-454b-a1f5-4e06838fbf80"
],
"precomputations": [
{
"arguments": [
"Test"
],
"created": "2023-10-14T05:25:20.000+0000",
"field": "issue",
"functionKey": "ari:cloud:ecosystem::extension/00000000-1111-2222-3333-4444444/111111-2222-3333-4444-55555/static/issuesWithText",
"functionName": "issuesWithText",
"id": "cf75a1b0-4ac6-4bd8-8a50-29a465a96520",
"operator": "in",
"updated": "2023-10-14T05:25:20.000+0000",
"used": "2023-10-14T05:25:20.000+0000",
"value": "issue in (TEST-1, TEST-2, TEST-3)"
},
{
"arguments": [
"10001"
],
"created": "2023-10-14T05:25:20.000+0000",
"error": "Error message to be displayed to the user",
"field": "issue",
"functionKey": "ari:cloud:ecosystem::extension/00000000-1111-2222-3333-4444444/111111-2222-3333-4444-55555/static/issuesWithText",
"functionName": "issuesWithText",
"id": "2a854f11-d0e1-4260-aea8-64a562a7062a",
"operator": "=",
"updated": "2023-10-14T05:25:20.000+0000",
"used": "2023-10-14T05:25:20.000+0000"
}
]
}
Rate this page: