Hi Hema,

Sorry, we've been pretty busy on our paid support tracker lately,
especially with the pandemic situation. (Small plug: We can help more
closely and quickly with in-house customizations with a support contract,
which might be useful if you're doing a lot of custom stuff.)

I looked into this, and this key is protected when this extension is
enabled. That means you can't patch it. If you disable the extension
temporarily, you should be able to modify it.

Patching, though, is probably the wrong approach. I think you want to just
set the field value, which is different. Set:

    extra_data.beanbag_notefield_notes_text_type=markdown
    extra_data.beanbag_notefield_notes=<your new text here>

If you want plain text, use 'plain' instead of 'markdown'.

To see a real-world example, open your browser's development tools, view
the Network tab, reload the page, and set the Note to Reviewers field.
You'll see the data that gets sent in.

Christian

On Sun, Apr 12, 2020 at 10:49 PM Hema <m.hemapr...@gmail.com> wrote:

> Can I get help on this, please?
>
> Regards,
> Hemapriya.
>
> On Friday, 3 April 2020 13:53:07 UTC+5:30, Hema wrote:
>>
>> 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 <m.hem...@gmail.com> 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 <trow...@gmail.com>
>>>> 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 <m.hem...@gmail.com> 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 revie...@googlegroups.com.
>>>>>> 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
>>>>> revie...@googlegroups.com.
>>>>> 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 revie...@googlegroups.com.
>>>> 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 reviewboard+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/reviewboard/28a0cae4-4329-4858-a6cd-c1eed1a2e141%40googlegroups.com
> <https://groups.google.com/d/msgid/reviewboard/28a0cae4-4329-4858-a6cd-c1eed1a2e141%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Christian Hammond
President/CEO of Beanbag <https://www.beanbaginc.com/>
Makers of Review Board <https://www.reviewboard.org/>

-- 
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 reviewboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/reviewboard/CAE7Vndmg3J-%2BKf4zP9YGaJbBcr7FkKviQ_cCEMV77G-cdJo%2Bzg%40mail.gmail.com.

Reply via email to