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

tylernathanreed / jira-client-php / 13993845991

21 Mar 2025 02:19PM UTC coverage: 78.648% (+3.1%) from 75.543%
13993845991

push

github

tylernathanreed
~ Fixed several tests

5400 of 6866 relevant lines covered (78.65%)

9.9 hits per line

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

76.32
/src/Operations/WorkflowTransitionProperties.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 WorkflowTransitionProperties
10
{
11
    /**
12
     * Returns the properties on a workflow transition.
13
     * Transition properties are used to change the behavior of a transition.
14
     * For more information, see "Transition properties" and "Workflow properties"
15
     * 
16
     * **"Permissions" required:** *Administer Jira* "global permission".
17
     * 
18
     * @link https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties
19
     * @link https://confluence.atlassian.com/x/JYlKLg
20
     * @link https://confluence.atlassian.com/x/x4dKLg
21
     * 
22
     * @param int $transitionId The ID of the transition.
23
     *                          To get the ID, view the workflow in text mode in the Jira administration console.
24
     *                          The ID is shown next to the transition.
25
     * @param string $workflowName The name of the workflow that the transition belongs to.
26
     * @param bool $includeReservedKeys Some properties with keys that have the *jira.* prefix are reserved, which means they are not editable.
27
     *                                  To include these properties in the results, set this parameter to *true*.
28
     * @param string $key The key of the property being returned, also known as the name of the property.
29
     *                    If this parameter is not specified, all properties on the transition are returned.
30
     * @param 'live'|'draft'|null $workflowMode
31
     *        The workflow status.
32
     *        Set to *live* for active and inactive workflows, or *draft* for draft workflows.
33
     * 
34
     * @return list<Schema\WorkflowTransitionProperty>
35
     */
36
    public function getWorkflowTransitionProperties(
1✔
37
        int $transitionId,
38
        string $workflowName,
39
        ?bool $includeReservedKeys = false,
40
        ?string $key = null,
41
        ?string $workflowMode = 'live',
42
    ): array {
43
        return $this->call(
1✔
44
            uri: '/rest/api/3/workflow/transitions/{transitionId}/properties',
1✔
45
            method: 'get',
1✔
46
            query: compact('workflowName', 'includeReservedKeys', 'key', 'workflowMode'),
1✔
47
            path: compact('transitionId'),
1✔
48
            success: 200,
1✔
49
            schema: [Schema\WorkflowTransitionProperty::class],
1✔
50
        );
1✔
51
    }
52

53
    /**
54
     * Updates a workflow transition by changing the property value.
55
     * Trying to update a property that does not exist results in a new property being added to the transition.
56
     * Transition properties are used to change the behavior of a transition.
57
     * For more information, see "Transition properties" and "Workflow properties"
58
     * 
59
     * **"Permissions" required:** *Administer Jira* "global permission".
60
     * 
61
     * @link https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties
62
     * @link https://confluence.atlassian.com/x/JYlKLg
63
     * @link https://confluence.atlassian.com/x/x4dKLg
64
     * 
65
     * @param int $transitionId The ID of the transition.
66
     *                          To get the ID, view the workflow in text mode in the Jira admin settings.
67
     *                          The ID is shown next to the transition.
68
     * @param string $key The key of the property being updated, also known as the name of the property.
69
     *                    Set this to the same value as the `key` defined in the request body.
70
     * @param string $workflowName The name of the workflow that the transition belongs to.
71
     * @param 'live'|'draft'|null $workflowMode
72
     *        The workflow status.
73
     *        Set to `live` for inactive workflows or `draft` for draft workflows.
74
     *        Active workflows cannot be edited.
75
     */
76
    public function updateWorkflowTransitionProperty(
1✔
77
        Schema\WorkflowTransitionProperty $request,
78
        int $transitionId,
79
        string $key,
80
        string $workflowName,
81
        ?string $workflowMode = null,
82
    ): Schema\WorkflowTransitionProperty {
83
        return $this->call(
1✔
84
            uri: '/rest/api/3/workflow/transitions/{transitionId}/properties',
1✔
85
            method: 'put',
1✔
86
            body: $request,
1✔
87
            query: compact('key', 'workflowName', 'workflowMode'),
1✔
88
            path: compact('transitionId'),
1✔
89
            success: 200,
1✔
90
            schema: Schema\WorkflowTransitionProperty::class,
1✔
91
        );
1✔
92
    }
93

94
    /**
95
     * Adds a property to a workflow transition.
96
     * Transition properties are used to change the behavior of a transition.
97
     * For more information, see "Transition properties" and "Workflow properties"
98
     * 
99
     * **"Permissions" required:** *Administer Jira* "global permission".
100
     * 
101
     * @link https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties
102
     * @link https://confluence.atlassian.com/x/JYlKLg
103
     * @link https://confluence.atlassian.com/x/x4dKLg
104
     * 
105
     * @param int $transitionId The ID of the transition.
106
     *                          To get the ID, view the workflow in text mode in the Jira admin settings.
107
     *                          The ID is shown next to the transition.
108
     * @param string $key The key of the property being added, also known as the name of the property.
109
     *                    Set this to the same value as the `key` defined in the request body.
110
     * @param string $workflowName The name of the workflow that the transition belongs to.
111
     * @param 'live'|'draft'|null $workflowMode
112
     *        The workflow status.
113
     *        Set to *live* for inactive workflows or *draft* for draft workflows.
114
     *        Active workflows cannot be edited.
115
     */
116
    public function createWorkflowTransitionProperty(
1✔
117
        Schema\WorkflowTransitionProperty $request,
118
        int $transitionId,
119
        string $key,
120
        string $workflowName,
121
        ?string $workflowMode = 'live',
122
    ): Schema\WorkflowTransitionProperty {
123
        return $this->call(
1✔
124
            uri: '/rest/api/3/workflow/transitions/{transitionId}/properties',
1✔
125
            method: 'post',
1✔
126
            body: $request,
1✔
127
            query: compact('key', 'workflowName', 'workflowMode'),
1✔
128
            path: compact('transitionId'),
1✔
129
            success: 200,
1✔
130
            schema: Schema\WorkflowTransitionProperty::class,
1✔
131
        );
1✔
132
    }
133

134
    /**
135
     * Deletes a property from a workflow transition.
136
     * Transition properties are used to change the behavior of a transition.
137
     * For more information, see "Transition properties" and "Workflow properties"
138
     * 
139
     * **"Permissions" required:** *Administer Jira* "global permission".
140
     * 
141
     * @link https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties
142
     * @link https://confluence.atlassian.com/x/JYlKLg
143
     * @link https://confluence.atlassian.com/x/x4dKLg
144
     * 
145
     * @param int $transitionId The ID of the transition.
146
     *                          To get the ID, view the workflow in text mode in the Jira admin settings.
147
     *                          The ID is shown next to the transition.
148
     * @param string $key The name of the transition property to delete, also known as the name of the property.
149
     * @param string $workflowName The name of the workflow that the transition belongs to.
150
     * @param 'live'|'draft'|null $workflowMode
151
     *        The workflow status.
152
     *        Set to `live` for inactive workflows or `draft` for draft workflows.
153
     *        Active workflows cannot be edited.
154
     */
155
    public function deleteWorkflowTransitionProperty(
×
156
        int $transitionId,
157
        string $key,
158
        string $workflowName,
159
        ?string $workflowMode = null,
160
    ): true {
161
        return $this->call(
×
162
            uri: '/rest/api/3/workflow/transitions/{transitionId}/properties',
×
163
            method: 'delete',
×
164
            query: compact('key', 'workflowName', 'workflowMode'),
×
165
            path: compact('transitionId'),
×
166
            success: 200,
×
167
            schema: true,
×
168
        );
×
169
    }
170
}
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