• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tylernathanreed / jira-client-php / 13634794100

03 Mar 2025 03:19PM UTC coverage: 2.067% (-0.1%) from 2.21%
13634794100

push

github

web-flow
~ Try coveralls action

140 of 6773 relevant lines covered (2.07%)

0.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Operations/WorkflowTransitionRules.php
1
<?php
2

3
namespace Jira\Client\Operations;
4

5
use Jira\Client\Client;
6
use Jira\Client\Schema;
7

8
/** @phpstan-require-extends Client */
9
trait WorkflowTransitionRules
10
{
11
    /**
12
     * Returns a "paginated" list of workflows with transition rules.
13
     * The workflows can be filtered to return only those containing workflow transition rules:
14
     * 
15
     *  - of one or more transition rule types, such as "workflow post functions"
16
     *  - matching one or more transition rule keys
17
     * 
18
     * Only workflows containing transition rules created by the calling "Connect" or "Forge" app are returned
19
     * 
20
     * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be ignored
21
     * 
22
     * **"Permissions" required:** Only "Connect" or "Forge" apps can use this operation.
23
     * 
24
     * @link https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/
25
     * @link https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps
26
     * @link https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps
27
     * 
28
     * @param list<'postfunction'|'condition'|'validator'> $types The types of the transition rules to return.
29
     * @param int $startAt The index of the first item to return in a page of results (page offset).
30
     * @param int $maxResults The maximum number of items to return per page.
31
     * @param ?list<string> $keys The transition rule class keys, as defined in the Connect or the Forge app descriptor, of the transition rules to return.
32
     * @param ?list<string> $workflowNames The list of workflow names to filter by.
33
     * @param ?list<string> $withTags The list of `tags` to filter by.
34
     * @param bool $draft Whether draft or published workflows are returned.
35
     *                    If not provided, both workflow types are returned.
36
     * @param string $expand Use "expand" to include additional information in the response.
37
     *                       This parameter accepts `transition`, which, for each rule, returns information about the transition the rule is assigned to.
38
     */
39
    public function getWorkflowTransitionRuleConfigurations(
×
40
        array $types,
41
        ?int $startAt = 0,
42
        ?int $maxResults = 10,
43
        ?array $keys = null,
44
        ?array $workflowNames = null,
45
        ?array $withTags = null,
46
        ?bool $draft = null,
47
        ?string $expand = null,
48
    ): Schema\PageBeanWorkflowTransitionRules {
49
        return $this->call(
×
50
            uri: '/rest/api/3/workflow/rule/config',
×
51
            method: 'get',
×
52
            query: compact('types', 'startAt', 'maxResults', 'keys', 'workflowNames', 'withTags', 'draft', 'expand'),
×
53
            success: 200,
×
54
            schema: Schema\PageBeanWorkflowTransitionRules::class,
×
55
        );
×
56
    }
57

58
    /**
59
     * Updates configuration of workflow transition rules.
60
     * The following rule types are supported:
61
     * 
62
     *  - "post functions"
63
     *  - "conditions"
64
     *  - "validators"
65
     * 
66
     * Only rules created by the calling "Connect" or "Forge" app can be updated
67
     * 
68
     * To assist with app migration, this operation can be used to:
69
     * 
70
     *  - Disable a rule
71
     *  - Add a `tag`.
72
     * Use this to filter rules in the "Get workflow transition rule configurations"
73
     * 
74
     * Rules are enabled if the `disabled` parameter is not provided
75
     * 
76
     * **"Permissions" required:** Only "Connect" or "Forge" apps can use this operation.
77
     * 
78
     * @link https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/
79
     * @link https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/
80
     * @link https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/
81
     * @link https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps
82
     * @link https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps
83
     * @link https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get
84
     */
85
    public function updateWorkflowTransitionRuleConfigurations(
×
86
        Schema\WorkflowTransitionRulesUpdate $request,
87
    ): Schema\WorkflowTransitionRulesUpdateErrors {
88
        return $this->call(
×
89
            uri: '/rest/api/3/workflow/rule/config',
×
90
            method: 'put',
×
91
            body: $request,
×
92
            success: 200,
×
93
            schema: Schema\WorkflowTransitionRulesUpdateErrors::class,
×
94
        );
×
95
    }
96

97
    /**
98
     * Deletes workflow transition rules from one or more workflows.
99
     * These rule types are supported:
100
     * 
101
     *  - "post functions"
102
     *  - "conditions"
103
     *  - "validators"
104
     * 
105
     * Only rules created by the calling Connect app can be deleted
106
     * 
107
     * **"Permissions" required:** Only Connect apps can use this operation.
108
     * 
109
     * @link https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/
110
     * @link https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/
111
     * @link https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/
112
     */
113
    public function deleteWorkflowTransitionRuleConfigurations(
×
114
        Schema\WorkflowsWithTransitionRulesDetails $request,
115
    ): Schema\WorkflowTransitionRulesUpdateErrors {
116
        return $this->call(
×
117
            uri: '/rest/api/3/workflow/rule/config/delete',
×
118
            method: 'put',
×
119
            body: $request,
×
120
            success: 200,
×
121
            schema: Schema\WorkflowTransitionRulesUpdateErrors::class,
×
122
        );
×
123
    }
124
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc