• 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/Status.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 Status
10
{
11
    /**
12
     * Returns a list of the statuses specified by one or more status IDs
13
     * 
14
     * **"Permissions" required:**
15
     * 
16
     *  - *Administer projects* "project permission."
17
     *  - *Administer Jira* "project permission."
18
     * 
19
     * @link https://confluence.atlassian.com/x/yodKLg
20
     * 
21
     * @param list<string> $id The list of status IDs.
22
     *                         To include multiple IDs, provide an ampersand-separated list.
23
     *                         For example, id=10000&id=10001
24
     *                         Min items `1`, Max items `50`
25
     * @param string $expand Deprecated.
26
     *                       See the "deprecation notice" for details
27
     *                       Use "expand" to include additional information in the response.
28
     *                       This parameter accepts a comma-separated list.
29
     *                       Expand options include:
30
     *                        - `usages` Returns the project and issue types that use the status in their workflow
31
     *                        - `workflowUsages` Returns the workflows that use the status.
32
     *                       @link https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298
33
     */
34
    public function getStatusesById(
×
35
        array $id,
36
        ?string $expand = null,
37
    ): true {
38
        return $this->call(
×
39
            uri: '/rest/api/3/statuses',
×
40
            method: 'get',
×
41
            query: compact('id', 'expand'),
×
42
            success: 200,
×
43
            schema: true,
×
44
        );
×
45
    }
46

47
    /**
48
     * Updates statuses by ID
49
     * 
50
     * **"Permissions" required:**
51
     * 
52
     *  - *Administer projects* "project permission."
53
     *  - *Administer Jira* "project permission."
54
     * 
55
     * @link https://confluence.atlassian.com/x/yodKLg
56
     */
57
    public function updateStatuses(
×
58
        Schema\StatusUpdateRequest $request,
59
    ): true {
60
        return $this->call(
×
61
            uri: '/rest/api/3/statuses',
×
62
            method: 'put',
×
63
            body: $request,
×
64
            success: 204,
×
65
            schema: true,
×
66
        );
×
67
    }
68

69
    /**
70
     * Creates statuses for a global or project scope
71
     * 
72
     * **"Permissions" required:**
73
     * 
74
     *  - *Administer projects* "project permission."
75
     *  - *Administer Jira* "project permission."
76
     * 
77
     * @link https://confluence.atlassian.com/x/yodKLg
78
     */
79
    public function createStatuses(
×
80
        Schema\StatusCreateRequest $request,
81
    ): true {
82
        return $this->call(
×
83
            uri: '/rest/api/3/statuses',
×
84
            method: 'post',
×
85
            body: $request,
×
86
            success: 200,
×
87
            schema: true,
×
88
        );
×
89
    }
90

91
    /**
92
     * Deletes statuses by ID
93
     * 
94
     * **"Permissions" required:**
95
     * 
96
     *  - *Administer projects* "project permission."
97
     *  - *Administer Jira* "project permission."
98
     * 
99
     * @link https://confluence.atlassian.com/x/yodKLg
100
     * 
101
     * @param list<string> $id The list of status IDs.
102
     *                         To include multiple IDs, provide an ampersand-separated list.
103
     *                         For example, id=10000&id=10001
104
     *                         Min items `1`, Max items `50`
105
     */
106
    public function deleteStatusesById(
×
107
        array $id,
108
    ): true {
109
        return $this->call(
×
110
            uri: '/rest/api/3/statuses',
×
111
            method: 'delete',
×
112
            query: compact('id'),
×
113
            success: 204,
×
114
            schema: true,
×
115
        );
×
116
    }
117

118
    /**
119
     * Returns a "paginated" list of statuses that match a search on name or project
120
     * 
121
     * **"Permissions" required:**
122
     * 
123
     *  - *Administer projects* "project permission."
124
     *  - *Administer Jira* "project permission."
125
     * 
126
     * @link https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination
127
     * @link https://confluence.atlassian.com/x/yodKLg
128
     * 
129
     * @param string $expand Deprecated.
130
     *                       See the "deprecation notice" for details
131
     *                       Use "expand" to include additional information in the response.
132
     *                       This parameter accepts a comma-separated list.
133
     *                       Expand options include:
134
     *                        - `usages` Returns the project and issue types that use the status in their workflow
135
     *                        - `workflowUsages` Returns the workflows that use the status.
136
     *                       @link https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298
137
     * @param string $projectId The project the status is part of or null for global statuses.
138
     * @param int $startAt The index of the first item to return in a page of results (page offset).
139
     * @param int $maxResults The maximum number of items to return per page.
140
     * @param string $searchString Term to match status names against or null to search for all statuses in the search scope.
141
     * @param string $statusCategory Category of the status to filter by.
142
     *                               The supported values are: `TODO`, `IN_PROGRESS`, and `DONE`.
143
     */
144
    public function search(
×
145
        ?string $expand = null,
146
        ?string $projectId = null,
147
        ?int $startAt = 0,
148
        ?int $maxResults = 200,
149
        ?string $searchString = null,
150
        ?string $statusCategory = null,
151
    ): Schema\PageOfStatuses {
152
        return $this->call(
×
153
            uri: '/rest/api/3/statuses/search',
×
154
            method: 'get',
×
155
            query: compact('expand', 'projectId', 'startAt', 'maxResults', 'searchString', 'statusCategory'),
×
156
            success: 200,
×
157
            schema: Schema\PageOfStatuses::class,
×
158
        );
×
159
    }
160

161
    /**
162
     * Returns a page of issue types in a project using a given status.
163
     * 
164
     * @param string $statusId The statusId to fetch issue type usages for
165
     * @param string $projectId The projectId to fetch issue type usages for
166
     * @param string $nextPageToken The cursor for pagination
167
     * @param int $maxResults The maximum number of results to return.
168
     *                        Must be an integer between 1 and 200.
169
     */
170
    public function getProjectIssueTypeUsagesForStatus(
×
171
        string $statusId,
172
        string $projectId,
173
        ?string $nextPageToken = null,
174
        ?int $maxResults = 50,
175
    ): Schema\StatusProjectIssueTypeUsageDTO {
176
        return $this->call(
×
177
            uri: '/rest/api/3/statuses/{statusId}/project/{projectId}/issueTypeUsages',
×
178
            method: 'get',
×
179
            query: compact('nextPageToken', 'maxResults'),
×
180
            path: compact('statusId', 'projectId'),
×
181
            success: 200,
×
182
            schema: Schema\StatusProjectIssueTypeUsageDTO::class,
×
183
        );
×
184
    }
185

186
    /**
187
     * Returns a page of projects using a given status.
188
     * 
189
     * @param string $statusId The statusId to fetch project usages for
190
     * @param string $nextPageToken The cursor for pagination
191
     * @param int $maxResults The maximum number of results to return.
192
     *                        Must be an integer between 1 and 200.
193
     */
194
    public function getProjectUsagesForStatus(
×
195
        string $statusId,
196
        ?string $nextPageToken = null,
197
        ?int $maxResults = 50,
198
    ): Schema\StatusProjectUsageDTO {
199
        return $this->call(
×
200
            uri: '/rest/api/3/statuses/{statusId}/projectUsages',
×
201
            method: 'get',
×
202
            query: compact('nextPageToken', 'maxResults'),
×
203
            path: compact('statusId'),
×
204
            success: 200,
×
205
            schema: Schema\StatusProjectUsageDTO::class,
×
206
        );
×
207
    }
208

209
    /**
210
     * Returns a page of workflows using a given status.
211
     * 
212
     * @param string $statusId The statusId to fetch workflow usages for
213
     * @param string $nextPageToken The cursor for pagination
214
     * @param int $maxResults The maximum number of results to return.
215
     *                        Must be an integer between 1 and 200.
216
     */
217
    public function getWorkflowUsagesForStatus(
×
218
        string $statusId,
219
        ?string $nextPageToken = null,
220
        ?int $maxResults = 50,
221
    ): Schema\StatusWorkflowUsageDTO {
222
        return $this->call(
×
223
            uri: '/rest/api/3/statuses/{statusId}/workflowUsages',
×
224
            method: 'get',
×
225
            query: compact('nextPageToken', 'maxResults'),
×
226
            path: compact('statusId'),
×
227
            success: 200,
×
228
            schema: Schema\StatusWorkflowUsageDTO::class,
×
229
        );
×
230
    }
231
}
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