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

tylernathanreed / jira-client-php / 13857440588

14 Mar 2025 01:18PM UTC coverage: 70.825% (-0.06%) from 70.885%
13857440588

push

github

tylernathanreed
~ Fixed nested objects in test examples

9 of 9 new or added lines in 1 file covered. (100.0%)

524 existing lines in 407 files now uncovered.

4826 of 6814 relevant lines covered (70.82%)

8.59 hits per line

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

75.0
/src/Operations/ProjectProperties.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 ProjectProperties
10
{
11
    /**
12
     * Returns all "project property" keys for the project
13
     * 
14
     * This operation can be accessed anonymously
15
     * 
16
     * **"Permissions" required:** *Browse Projects* "project permission" for the project.
17
     * 
18
     * @link https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties
19
     * @link https://confluence.atlassian.com/x/yodKLg
20
     * 
21
     * @param string $projectIdOrKey The project ID or project key (case sensitive).
22
     */
23
    public function getProjectPropertyKeys(
1✔
24
        string $projectIdOrKey,
25
    ): Schema\PropertyKeys {
26
        return $this->call(
1✔
27
            uri: '/rest/api/3/project/{projectIdOrKey}/properties',
1✔
28
            method: 'get',
1✔
29
            path: compact('projectIdOrKey'),
1✔
30
            success: 200,
1✔
31
            schema: Schema\PropertyKeys::class,
1✔
32
        );
1✔
33
    }
34

35
    /**
36
     * Returns the value of a "project property"
37
     * 
38
     * This operation can be accessed anonymously
39
     * 
40
     * **"Permissions" required:** *Browse Projects* "project permission" for the project containing the property.
41
     * 
42
     * @link https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties
43
     * @link https://confluence.atlassian.com/x/yodKLg
44
     * 
45
     * @param string $projectIdOrKey The project ID or project key (case sensitive).
46
     * @param string $propertyKey The project property key.
47
     *                            Use "Get project property keys" to get a list of all project property keys.
48
     */
49
    public function getProjectProperty(
1✔
50
        string $projectIdOrKey,
51
        string $propertyKey,
52
    ): Schema\EntityProperty {
53
        return $this->call(
1✔
54
            uri: '/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey}',
1✔
55
            method: 'get',
1✔
56
            path: compact('projectIdOrKey', 'propertyKey'),
1✔
57
            success: 200,
1✔
58
            schema: Schema\EntityProperty::class,
1✔
59
        );
1✔
60
    }
61

62
    /**
63
     * Sets the value of the "project property".
64
     * You can use project properties to store custom data against the project
65
     * 
66
     * The value of the request body must be a "valid", non-empty JSON blob.
67
     * The maximum length is 32768 characters
68
     * 
69
     * This operation can be accessed anonymously
70
     * 
71
     * **"Permissions" required:** *Administer Jira* "global permission" or *Administer Projects* "project permission" for the project in which the property is created.
72
     * 
73
     * @link https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties
74
     * @link http://tools.ietf.org/html/rfc4627
75
     * @link https://confluence.atlassian.com/x/x4dKLg
76
     * @link https://confluence.atlassian.com/x/yodKLg
77
     * 
78
     * @param string $projectIdOrKey The project ID or project key (case sensitive).
79
     * @param string $propertyKey The key of the project property.
80
     *                            The maximum length is 255 characters.
81
     */
UNCOV
82
    public function setProjectProperty(
×
83
        string $projectIdOrKey,
84
        string $propertyKey,
85
    ): true {
86
        return $this->call(
×
87
            uri: '/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey}',
×
88
            method: 'put',
×
89
            path: compact('projectIdOrKey', 'propertyKey'),
×
90
            success: 200,
×
91
            schema: true,
×
92
        );
×
93
    }
94

95
    /**
96
     * Deletes the "property" from a project
97
     * 
98
     * This operation can be accessed anonymously
99
     * 
100
     * **"Permissions" required:** *Administer Jira* "global permission" or *Administer Projects* "project permission" for the project containing the property.
101
     * 
102
     * @link https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties
103
     * @link https://confluence.atlassian.com/x/x4dKLg
104
     * @link https://confluence.atlassian.com/x/yodKLg
105
     * 
106
     * @param string $projectIdOrKey The project ID or project key (case sensitive).
107
     * @param string $propertyKey The project property key.
108
     *                            Use "Get project property keys" to get a list of all project property keys.
109
     */
110
    public function deleteProjectProperty(
1✔
111
        string $projectIdOrKey,
112
        string $propertyKey,
113
    ): true {
114
        return $this->call(
1✔
115
            uri: '/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey}',
1✔
116
            method: 'delete',
1✔
117
            path: compact('projectIdOrKey', 'propertyKey'),
1✔
118
            success: 204,
1✔
119
            schema: true,
1✔
120
        );
1✔
121
    }
122
}
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