• 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/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
    public function getWorkflowTransitionProperties(
×
35
        int $transitionId,
36
        string $workflowName,
37
        ?bool $includeReservedKeys = false,
38
        ?string $key = null,
39
        ?string $workflowMode = 'live',
40
    ): Schema\WorkflowTransitionProperty {
41
        return $this->call(
×
42
            uri: '/rest/api/3/workflow/transitions/{transitionId}/properties',
×
43
            method: 'get',
×
44
            query: compact('workflowName', 'includeReservedKeys', 'key', 'workflowMode'),
×
45
            path: compact('transitionId'),
×
46
            success: 200,
×
47
            schema: Schema\WorkflowTransitionProperty::class,
×
48
        );
×
49
    }
50

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

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

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