Still no luck. Got the following error for the suggested code.
CRITICAL: extra_data: Failed to patch JSON data: Syntax error in path
"beanbag_notefield_notes" for patch entry 0: Paths must either be empty or
start with a "/"
Hence added "/" in path. But got the following error.
CRITICAL: extra_data: Failed to patch JSON data: Cannot write to path
"/beanbag_notefield_notes" for patch entry 0
What should be the path to update 'beanbag_notefield_notes'?
Regards,
Hemapriya.
On Thursday, 2 April 2020 22:51:56 UTC+5:30, David Trowbridge wrote:
>
> After looking a little deeper, it looks like the json-patch data needs to
> be in an array, but also serialized. Try this:
>
> kwargs = {
> 'extra_data:json-patch': json.dumps(
> [
> {
> 'op': 'replace',
> 'path': 'beanbag_notefield_notes',
> 'value': 'hsagds',
> },
> ]
> ),
> }
>
> On Tue, Mar 31, 2020 at 10:43 PM Hemapriya <[email protected]
> <javascript:>> wrote:
>
>> Thanks for the reply. But we still face problem updating this field.
>> Please find it below.
>>
>> >>> Making HTTP PUT request to
>> https://reviewboard.com/api/review-requests/29254/draft/
>> >>> Got API Error 105 (HTTP code 400): One or more fields had errors
>> >>> Error data: {u'fields': {u'extra_data': [u'Could not parse JSON data:
>> Expecting property name enclosed in double quotes: line 1 column 2 (char
>> 1)']}, u'stat': u'fail', u'err': {u'msg': u'One or more fields had errors',
>> u'code': 105}}
>> ...
>> File "/usr/hemapriya/p4/rbtools/../rbtools/commands/post.py", line 817,
>> in post_request
>> draft = draft.update(**kwargs)
>> File "/usr/hemapriya/p4/rbtools/../rbtools/api/resource.py", line 181,
>> in <lambda>
>> meth(resource, **kwargs)))
>> File "/usr/hemapriya/p4/rbtools/../rbtools/api/decorators.py", line 27,
>> in request_method
>> *args, **kwargs)
>> File "/usr/hemapriya/p4/rbtools/../rbtools/api/transport/sync.py", line
>> 77, in execute_request_method
>> return self._execute_request(request)
>> File "/usr/hemapriya/p4/rbtools/../rbtools/api/transport/sync.py", line
>> 86, in _execute_request
>> rsp = self.server.make_request(request)
>> File "/usr/hemapriya/p4/rbtools/../rbtools/api/request.py", line 687,
>> in make_request
>> self.process_error(e.code, e.read())
>> File "/usr/hemapriya/p4/rbtools/../rbtools/api/request.py", line 661,
>> in process_error
>> rsp['err']['msg'])
>> rbtools.api.errors.BadRequestError: extra_data: Could not parse JSON
>> data: Expecting property name enclosed in double quotes: line 1 column 2
>> (char 1)
>>
>> My code looks like:
>> kwargs = {"extra_data:json-patch": {"op":"replace",
>> "path":"beanbag_notefield_notes", "value":"hsagds"}}
>> draft = draft.update(**kwargs)
>>
>> Could you please help?
>>
>> Thanks,
>> Hemapriya.
>>
>> On Tue, Mar 31, 2020 at 11:16 PM David Trowbridge <[email protected]
>> <javascript:>> wrote:
>>
>>> It would be helpful if you included any error messages, but I suspect
>>> it's just a Python syntax problem--argument names can't contain a ":"
>>> character.
>>>
>>> We should be able to get around this using a kwargs dict:
>>>
>>> kwargs = {
>>> 'extra_data:json-patch': {
>>> 'op': 'replace',
>>> 'path': 'beanbag_notefield_notes',
>>> 'value': 'hsagds',
>>> },
>>> }
>>>
>>> draft.update(**kwargs)
>>>
>>>
>>> David
>>>
>>>
>>> On Tue, Mar 31, 2020 at 12:41 AM Hema <[email protected] <javascript:>>
>>> wrote:
>>>
>>>> We use ReviewBoard 3.0.3 and RBTools 1.0.2. We try to update review
>>>> request draft's beanbag_notefield_notes like below.
>>>>
>>>> draft = draft.update(extra_data:json-patch={'op':'replace',
>>>> 'path':'beanbag_notefield_notes','value':'hsagds'})
>>>>
>>>> But it doesn't work. Could you please point the mistake, here?
>>>>
>>>> Thanks,
>>>> Hemapriya.
>>>>
>>>> --
>>>> Supercharge your Review Board with Power Pack:
>>>> https://www.reviewboard.org/powerpack/
>>>> Want us to host Review Board for you? Check out RBCommons:
>>>> https://rbcommons.com/
>>>> Happy user? Let us know! https://www.reviewboard.org/users/
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Review Board Community" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected] <javascript:>.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/reviewboard/1405414c-2d37-4b71-a653-9828873ce591%40googlegroups.com
>>>>
>>>> <https://groups.google.com/d/msgid/reviewboard/1405414c-2d37-4b71-a653-9828873ce591%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> Supercharge your Review Board with Power Pack:
>>> https://www.reviewboard.org/powerpack/
>>> Want us to host Review Board for you? Check out RBCommons:
>>> https://rbcommons.com/
>>> Happy user? Let us know! https://www.reviewboard.org/users/
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Review Board Community" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/reviewboard/rIRitlsdNfU/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> [email protected] <javascript:>.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/reviewboard/CAFS3VNUnv5GWL7VGFwmYCLD3VGdxDqSu4aGVeV4p3%3D5%3Dy6o7SA%40mail.gmail.com
>>>
>>> <https://groups.google.com/d/msgid/reviewboard/CAFS3VNUnv5GWL7VGFwmYCLD3VGdxDqSu4aGVeV4p3%3D5%3Dy6o7SA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> Supercharge your Review Board with Power Pack:
>> https://www.reviewboard.org/powerpack/
>> Want us to host Review Board for you? Check out RBCommons:
>> https://rbcommons.com/
>> Happy user? Let us know! https://www.reviewboard.org/users/
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Review Board Community" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/reviewboard/CACfhYKeLEw6fM6teRWdqMLw8ta966Cx9tqvno%3DBDqcnGX%3DLvHQ%40mail.gmail.com
>>
>> <https://groups.google.com/d/msgid/reviewboard/CACfhYKeLEw6fM6teRWdqMLw8ta966Cx9tqvno%3DBDqcnGX%3DLvHQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
--
Supercharge your Review Board with Power Pack:
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons:
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups
"Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/reviewboard/7a522973-62b4-40ee-9fef-9ca43c8065d5%40googlegroups.com.