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

tylernathanreed / jira-client-php / 13834920235

13 Mar 2025 12:45PM UTC coverage: 71.089% (-2.2%) from 73.289%
13834920235

push

github

tylernathanreed
Merge branch 'master' of github.com:tylernathanreed/jira-client-php

3976 of 5593 relevant lines covered (71.09%)

9.76 hits per line

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

62.69
/src/Operations/PrioritySchemes.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 PrioritySchemes
10
{
11
    /**
12
     * Returns a "paginated" list of priority schemes
13
     * 
14
     * **"Permissions" required:** Permission to access Jira.
15
     * 
16
     * @param string $startAt The index of the first item to return in a page of results (page offset).
17
     * @param string $maxResults The maximum number of items to return per page.
18
     * @param ?list<int> $priorityId A set of priority IDs to filter by.
19
     *                               To include multiple IDs, provide an ampersand-separated list.
20
     *                               For example, `priorityId=10000&priorityId=10001`.
21
     * @param ?list<int> $schemeId A set of priority scheme IDs.
22
     *                             To include multiple IDs, provide an ampersand-separated list.
23
     *                             For example, `schemeId=10000&schemeId=10001`.
24
     * @param string $schemeName The name of scheme to search for.
25
     * @param bool $onlyDefault Whether only the default priority is returned.
26
     * @param 'name'|'+name'|'-name'|null $orderBy
27
     *        The ordering to return the priority schemes by.
28
     * @param string $expand A comma separated list of additional information to return.
29
     *                       "priorities" will return priorities associated with the priority scheme.
30
     *                       "projects" will return projects associated with the priority scheme.
31
     *                       `expand=priorities,projects`.
32
     */
33
    public function getPrioritySchemes(
1✔
34
        ?string $startAt = '0',
35
        ?string $maxResults = '50',
36
        ?array $priorityId = null,
37
        ?array $schemeId = null,
38
        ?string $schemeName = '',
39
        ?bool $onlyDefault = false,
40
        ?string $orderBy = '+name',
41
        ?string $expand = null,
42
    ): Schema\PageBeanPrioritySchemeWithPaginatedPrioritiesAndProjects {
43
        return $this->call(
1✔
44
            uri: '/rest/api/3/priorityscheme',
1✔
45
            method: 'get',
1✔
46
            query: compact('startAt', 'maxResults', 'priorityId', 'schemeId', 'schemeName', 'onlyDefault', 'orderBy', 'expand'),
1✔
47
            success: 200,
1✔
48
            schema: Schema\PageBeanPrioritySchemeWithPaginatedPrioritiesAndProjects::class,
1✔
49
        );
1✔
50
    }
51

52
    /**
53
     * Creates a new priority scheme
54
     * 
55
     * **"Permissions" required:** *Administer Jira* "global permission".
56
     * 
57
     * @link https://confluence.atlassian.com/x/x4dKLg
58
     */
59
    public function createPriorityScheme(
×
60
        Schema\CreatePrioritySchemeDetails $request,
61
    ): Schema\PrioritySchemeId {
62
        return $this->call(
×
63
            uri: '/rest/api/3/priorityscheme',
×
64
            method: 'post',
×
65
            body: $request,
×
66
            success: 201,
×
67
            schema: Schema\PrioritySchemeId::class,
×
68
        );
×
69
    }
70

71
    /**
72
     * Returns a "paginated" list of priorities that would require mapping, given a change in priorities or projects associated with a priority scheme
73
     * 
74
     * **"Permissions" required:** Permission to access Jira.
75
     */
76
    public function suggestedPrioritiesForMappings(
×
77
        Schema\SuggestedMappingsRequestBean $request,
78
    ): Schema\PageBeanPriorityWithSequence {
79
        return $this->call(
×
80
            uri: '/rest/api/3/priorityscheme/mappings',
×
81
            method: 'post',
×
82
            body: $request,
×
83
            success: 200,
×
84
            schema: Schema\PageBeanPriorityWithSequence::class,
×
85
        );
×
86
    }
87

88
    /**
89
     * Returns a "paginated" list of priorities available for adding to a priority scheme
90
     * 
91
     * **"Permissions" required:** Permission to access Jira.
92
     * 
93
     * @param string $schemeId The priority scheme ID.
94
     * @param string $startAt The index of the first item to return in a page of results (page offset).
95
     * @param string $maxResults The maximum number of items to return per page.
96
     * @param string $query The string to query priorities on by name.
97
     * @param ?list<string> $exclude A list of priority IDs to exclude from the results.
98
     */
99
    public function getAvailablePrioritiesByPriorityScheme(
1✔
100
        string $schemeId,
101
        ?string $startAt = '0',
102
        ?string $maxResults = '50',
103
        ?string $query = '',
104
        ?array $exclude = null,
105
    ): Schema\PageBeanPriorityWithSequence {
106
        return $this->call(
1✔
107
            uri: '/rest/api/3/priorityscheme/priorities/available',
1✔
108
            method: 'get',
1✔
109
            query: compact('schemeId', 'startAt', 'maxResults', 'query', 'exclude'),
1✔
110
            success: 200,
1✔
111
            schema: Schema\PageBeanPriorityWithSequence::class,
1✔
112
        );
1✔
113
    }
114

115
    /**
116
     * Updates a priority scheme.
117
     * This includes its details, the lists of priorities and projects in it
118
     * 
119
     * **"Permissions" required:** *Administer Jira* "global permission".
120
     * 
121
     * @link https://confluence.atlassian.com/x/x4dKLg
122
     * 
123
     * @param int $schemeId The ID of the priority scheme.
124
     */
125
    public function updatePriorityScheme(
×
126
        Schema\UpdatePrioritySchemeRequestBean $request,
127
        int $schemeId,
128
    ): Schema\UpdatePrioritySchemeResponseBean {
129
        return $this->call(
×
130
            uri: '/rest/api/3/priorityscheme/{schemeId}',
×
131
            method: 'put',
×
132
            body: $request,
×
133
            path: compact('schemeId'),
×
134
            success: 202,
×
135
            schema: Schema\UpdatePrioritySchemeResponseBean::class,
×
136
        );
×
137
    }
138

139
    /**
140
     * Deletes a priority scheme
141
     * 
142
     * This operation is only available for priority schemes without any associated projects.
143
     * Any associated projects must be removed from the priority scheme before this operation can be performed
144
     * 
145
     * **"Permissions" required:** *Administer Jira* "global permission".
146
     * 
147
     * @link https://confluence.atlassian.com/x/x4dKLg
148
     * 
149
     * @param int $schemeId The priority scheme ID.
150
     */
151
    public function deletePriorityScheme(
1✔
152
        int $schemeId,
153
    ): true {
154
        return $this->call(
1✔
155
            uri: '/rest/api/3/priorityscheme/{schemeId}',
1✔
156
            method: 'delete',
1✔
157
            path: compact('schemeId'),
1✔
158
            success: 204,
1✔
159
            schema: true,
1✔
160
        );
1✔
161
    }
162

163
    /**
164
     * Returns a "paginated" list of priorities by scheme
165
     * 
166
     * **"Permissions" required:** Permission to access Jira.
167
     * 
168
     * @param string $schemeId The priority scheme ID.
169
     * @param string $startAt The index of the first item to return in a page of results (page offset).
170
     * @param string $maxResults The maximum number of items to return per page.
171
     */
172
    public function getPrioritiesByPriorityScheme(
1✔
173
        string $schemeId,
174
        ?string $startAt = '0',
175
        ?string $maxResults = '50',
176
    ): Schema\PageBeanPriorityWithSequence {
177
        return $this->call(
1✔
178
            uri: '/rest/api/3/priorityscheme/{schemeId}/priorities',
1✔
179
            method: 'get',
1✔
180
            query: compact('startAt', 'maxResults'),
1✔
181
            path: compact('schemeId'),
1✔
182
            success: 200,
1✔
183
            schema: Schema\PageBeanPriorityWithSequence::class,
1✔
184
        );
1✔
185
    }
186

187
    /**
188
     * Returns a "paginated" list of projects by scheme
189
     * 
190
     * **"Permissions" required:** Permission to access Jira.
191
     * 
192
     * @param string $schemeId The priority scheme ID.
193
     * @param string $startAt The index of the first item to return in a page of results (page offset).
194
     * @param string $maxResults The maximum number of items to return per page.
195
     * @param ?list<int> $projectId The project IDs to filter by.
196
     *                              For example, `projectId=10000&projectId=10001`.
197
     * @param string $query The string to query projects on by name.
198
     */
199
    public function getProjectsByPriorityScheme(
1✔
200
        string $schemeId,
201
        ?string $startAt = '0',
202
        ?string $maxResults = '50',
203
        ?array $projectId = null,
204
        ?string $query = '',
205
    ): Schema\PageBeanProject {
206
        return $this->call(
1✔
207
            uri: '/rest/api/3/priorityscheme/{schemeId}/projects',
1✔
208
            method: 'get',
1✔
209
            query: compact('startAt', 'maxResults', 'projectId', 'query'),
1✔
210
            path: compact('schemeId'),
1✔
211
            success: 200,
1✔
212
            schema: Schema\PageBeanProject::class,
1✔
213
        );
1✔
214
    }
215
}
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