@@ 73-99 (lines=27) @@ | ||
70 | * |
|
71 | * @return array |
|
72 | */ |
|
73 | public function addWorklog( |
|
74 | $issue, |
|
75 | $timeSpent, |
|
76 | $comment = null, |
|
77 | $started = null, |
|
78 | $adjustEstimate = null, |
|
79 | $newEstimate = null, |
|
80 | $reduceBy = null |
|
81 | ) { |
|
82 | $parameters = [ |
|
83 | self::PARAM_ADJUST_ESTIMATE => $adjustEstimate, |
|
84 | self::PARAM_NEW_ESTIMATE => $newEstimate, |
|
85 | self::PARAM_REDUCE_BY => $reduceBy, |
|
86 | ]; |
|
87 | $payload = [ |
|
88 | self::PAYLOAD_COMMENT => $comment, |
|
89 | self::PAYLOAD_TIME_SPENT => $timeSpent, |
|
90 | self::PAYLOAD_STARTED => $started |
|
91 | ]; |
|
92 | ||
93 | return $this->apiClient->callEndpoint( |
|
94 | __e('%1/%2/%3', self::ENDPOINT, $issue, self::EP_WORKLOG), |
|
95 | $parameters, |
|
96 | Serializer::encode($payload), |
|
97 | HttpMethod::POST |
|
98 | ); |
|
99 | } |
|
100 | ||
101 | /** |
|
102 | * Update worklog for an issue [STATUS 200] |
|
@@ 123-148 (lines=26) @@ | ||
120 | * |
|
121 | * @return array |
|
122 | */ |
|
123 | public function updateWorklog( |
|
124 | $issue, |
|
125 | $worklogId, |
|
126 | $timeSpent, |
|
127 | $comment = null, |
|
128 | $started = null, |
|
129 | $adjustEstimate = null, |
|
130 | $newEstimate = null |
|
131 | ) { |
|
132 | $parameters = [ |
|
133 | self::PARAM_ADJUST_ESTIMATE => $adjustEstimate, |
|
134 | self::PARAM_NEW_ESTIMATE => $newEstimate |
|
135 | ]; |
|
136 | $payload = [ |
|
137 | self::PAYLOAD_COMMENT => $comment, |
|
138 | self::PAYLOAD_TIME_SPENT => $timeSpent, |
|
139 | self::PAYLOAD_STARTED => $started |
|
140 | ]; |
|
141 | ||
142 | return $this->apiClient->callEndpoint( |
|
143 | __e('%1/%2/%3/%4', self::ENDPOINT, $issue, self::EP_WORKLOG, $worklogId), |
|
144 | $parameters, |
|
145 | Serializer::encode($payload), |
|
146 | HttpMethod::PUT |
|
147 | ); |
|
148 | } |
|
149 | ||
150 | /** |
|
151 | * Delete worklog for an issue [STATUS 204] |