This resource represents workflow transition rules. Workflow transition rules define a Connect or a Forge app routine, such as a workflow post functions that is executed in association with the workflow. Use it to read and modify configuration of workflow transition rules.
Returns a paginated list of workflows with transition rules. The workflows can be filtered to return only those containing workflow transition rules:
Only workflows containing transition rules created by the calling Connect or Forge app are returned.
Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be ignored.
Permissions required: Only Connect or Forge apps can use this operation.
manage:jira-configuration
read:workflow:jira
Connect app scope required: READ
integer
integer
array<string>
Requiredarray<string>
array<string>
array<string>
boolean
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/workflow/rule/config?types={types}`, {
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
"isLast": true,
"maxResults": 10,
"startAt": 0,
"total": 1,
"values": [
{
"workflowId": {
"name": "My Workflow name",
"draft": false
},
"postFunctions": [
{
"id": "b4d6cbdc-59f5-11e9-8647-d663bd873d93",
"key": "postfunction-key",
"configuration": {
"value": "{ \"color\": \"red\" }",
"disabled": false,
"tag": "Sample tag"
},
"transition": {
"id": 1,
"name": "Open"
}
}
],
"conditions": [
{
"id": "d663bd873d93-59f5-11e9-8647-b4d6cbdc",
"key": "condition-key",
"configuration": {
"value": "{ \"size\": \"medium\" }",
"disabled": false,
"tag": "Another tag"
},
"transition": {
"id": 1,
"name": "Open"
}
}
],
"validators": [
{
"id": "11e9-59f5-b4d6cbdc-8647-d663bd873d93",
"key": "validator-key",
"configuration": {
"value": "\"{ \\\"shape\\\": \\\"square\\\" }\"",
"disabled": false
},
"transition": {
"id": 1,
"name": "Open"
}
}
]
}
]
}
Updates configuration of workflow transition rules. The following rule types are supported:
Only rules created by the calling Connect or Forge app can be updated.
To assist with app migration, this operation can be used to:
tag
. Use this to filter rules in the Get workflow transition rule configurations.Rules are enabled if the disabled
parameter is not provided.
Permissions required: Only Connect or Forge apps can use this operation.
manage:jira-configuration
write:workflow:jira
Connect app scope required: ADMIN
array<WorkflowTransitionRules>
RequiredReturned if the request is successful.
Details of any errors encountered while updating workflow transition rules.
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `{
"workflows": [
{
"conditions": [
{
"configuration": {
"disabled": false,
"tag": "Another tag",
"value": "{ \"size\": \"medium\" }"
},
"id": "d663bd873d93-59f5-11e9-8647-b4d6cbdc"
}
],
"postFunctions": [
{
"configuration": {
"disabled": false,
"tag": "Sample tag",
"value": "{ \"color\": \"red\" }"
},
"id": "b4d6cbdc-59f5-11e9-8647-d663bd873d93"
}
],
"validators": [
{
"configuration": {
"disabled": false,
"value": "{ \"shape\": \"square\" }"
},
"id": "11e9-59f5-b4d6cbdc-8647-d663bd873d93"
}
],
"workflowId": {
"draft": false,
"name": "My Workflow name"
}
}
]
}`;
const response = await api.asUser().requestJira(route`/rest/api/3/workflow/rule/config`, {
method: 'PUT',
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
{
"updateResults": [
{
"workflowId": {
"name": "Workflow with one rule not updated",
"draft": false
},
"ruleUpdateErrors": {
"example-rule-id": [
"The rule with this id does not exist: example-rule-id"
]
},
"updateErrors": []
},
{
"workflowId": {
"name": "Workflow with all rules successfully updated",
"draft": true
},
"ruleUpdateErrors": {},
"updateErrors": []
},
{
"workflowId": {
"name": "Non-existing workflow",
"draft": false
},
"ruleUpdateErrors": {},
"updateErrors": [
"Workflow not found: WorkflowIdBean{name=Non-existing workflow, draft=false}"
]
}
]
}
Deletes workflow transition rules from one or more workflows. These rule types are supported:
Only rules created by the calling Connect app can be deleted.
Permissions required: Only Connect apps can use this operation.
Connect app scope required: ADMIN
array<WorkflowTransitionRulesDetails>
RequiredReturned if the request is successful.
Details of any errors encountered while updating workflow transition rules.
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
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/jira/platform/rest/v3/#authentication
import api, { route } from "@forge/api";
var bodyData = `{
"workflows": [
{
"workflowId": {
"draft": false,
"name": "Internal support workflow"
},
"workflowRuleIds": [
"b4d6cbdc-59f5-11e9-8647-d663bd873d93",
"d663bd873d93-59f5-11e9-8647-b4d6cbdc",
"11e9-59f5-b4d6cbdc-8647-d663bd873d93"
]
}
]
}`;
const response = await api.requestJira(route`/rest/api/3/workflow/rule/config/delete`, {
method: 'PUT',
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
{
"updateResults": [
{
"workflowId": {
"name": "Workflow with one rule not updated",
"draft": false
},
"ruleUpdateErrors": {
"example-rule-id": [
"The rule with this id does not exist: example-rule-id"
]
},
"updateErrors": []
},
{
"workflowId": {
"name": "Workflow with all rules successfully updated",
"draft": true
},
"ruleUpdateErrors": {},
"updateErrors": []
},
{
"workflowId": {
"name": "Non-existing workflow",
"draft": false
},
"ruleUpdateErrors": {},
"updateErrors": [
"Workflow not found: WorkflowIdBean{name=Non-existing workflow, draft=false}"
]
}
]
}
Rate this page: