Rally Software

 View Only
Expand all | Collapse all
  • 1.  Batch Update

    Posted Jun 10, 2020 01:45 AM
    Hi Friends,
    I faced an issue on Batch update on rally attribute. I am trying to update a rally attribute in a sort order from batch operation api.
    But I am getting below error,

    https://rally1.rallydev.com/slm/doc/webservice/bulk.jsp

    Post Request:

    {
    "Batch": [
    {
    "Entry": {
    "Path": "/AllowedAttributeValue/create",
    "Method": "PUT",
    "Body": {
    "AttributeDefinition": {
    "_ref": "/attributedefinition/369144490"
    },
    "StringValue": "abc",
    "ValueIndex": 1
    }
    }
    }
    ]
    }

    {"errors":["Cannot parse input stream due to I/O error as JSON document: Parse error: expected '\"' but saw '}' [ chars read = >>>{}<<< ]"],"level":"error","message":"error on createRallyQuery {\"Batch\":[{\"Entry\":{\"Path\":\"/AllowedAttributeValue/create\",\"Method\":\"POST\",\"Body\":{\"AttributeDefinition\":\"/attributedefinition/369144498240\",\"StringValue\":\"abc\",\"ValueIndex\":1}}}]}","timestamp":"2020-06-09T10:15:56-07:00"}

    Can someone help ?


  • 2.  RE: Batch Update

    Broadcom Employee
    Posted Jun 10, 2020 02:10 AM
    Hi.

    Your JSON structure is missing the "AllowedAttributeValue" section. See my screenshot below, I highlighted the missing line (and its closing bracket).

    Essentially, after the 'Body' you need a structure for the "AllowedAttributeValue"

    Let me know if that helped.

    Thanks,
    Sagi


  • 3.  RE: Batch Update

    Posted Jun 10, 2020 01:15 PM
    Thanks Sagi.

    We still having the same error.  We are trying to update a custom attribute. 

     Input JSON

    {

      "Batch": [

        {

          "Entry": {

            "Path": "/AllowedAttributeValue/create",

            "Method": "PUT",

            "Body": {

                                    "AllowedAttributeValue"{

              "AttributeDefinition": {

                "_ref": "/attributedefinition/369144498240"

              },

              "StringValue": "E95",

              "ValueIndex": 1

            }

                                  }

          }

        }

      ]

    }



    {"errors":["Cannot parse input stream due to I/O error as JSON document: Parse error: expected '\"' but saw '}' [ chars read = >>>{}<<< ]"],"level":"error","message":"error on createRallyQuery {\"Batch\":[{\"Entry\":{\"Path\":\"/AllowedAttributeValue/create\",\"Method\":\"PUT\",\"Body\":{\"AllowedAttributeValue\":{\"AttributeDefinition\":{\"_ref\":\"/attributedefinition/369144498240\"},\"StringValue\":\"E95\",\"ValueIndex\":1}}}}]}","timestamp":"2020-06-10T09:41:13-07:00"}




  • 4.  RE: Batch Update

    Broadcom Employee
    Posted Jun 10, 2020 01:23 PM
    Hi.

    In your line

    "AllowedAttributeValue"{

    You are missing a colon character.

    Can you replace that line with:

    "AllowedAttributeValue": {


    Does that help?
    Sagi


  • 5.  RE: Batch Update

    Posted Jun 10, 2020 01:30 PM

    still the same error

    {

      "Batch": [

        {

          "Entry": {

            "Path": "/AllowedAttributeValue/create",

            "Method": "PUT",

            "Body": {

                                    "AllowedAttributeValue" : {

              "AttributeDefinition": {

                "_ref": "/attributedefinition/369144498240"

              },

              "StringValue": "E95",

              "ValueIndex": 1

            }

                                  }

          }

        }

      ]

    }




  • 6.  RE: Batch Update

    Broadcom Employee
    Posted Jun 10, 2020 01:42 PM
    Hi.

    Pasting the code into this text editor is a bit messing up the spacing, so I'm including a screenshot instead, perhaps you can also include screenshots instead.
    I took out the 'ValueIndex' line, took out the comma in the 'StringValue' line. Can you try that?

    If still same issue: Please change the Method = PUT to be Method = POST. Does that help?
    The 'Batch' endpoint is documented to require using POST (not PUT). I tried both and both work for me, but if you're still failing, then change it to POST, maybe it'll make a difference.

    If that also isn't helping then:
    Are you sure that you have an attribute definition ObjectID of: 369144498240 ?

    See my screenshot editing your code:

    Thanks,
    Sagi



  • 7.  RE: Batch Update

    Posted Jun 10, 2020 02:11 PM

    Hi Sagi,

    I tried all possible combinations you suggested ,but its is not working.
    We re-validated the Object ID , its is the correct one.

    Have you tried Batch Update on custom filed ?

    Best Regards,
    Lala




  • 8.  RE: Batch Update

    Broadcom Employee
    Posted Jun 10, 2020 02:13 PM
    Hi Lala,

    Yes, in the screenshot I included for you last night (in my first reply on this thread), I shared with you a code that's working for me and adding a drop-down value to a custom multi-valued field. So, yes, I did try it.

    Which is that field that you're trying to update? Is it a multi-valued custom field? what object is it on? Defect? User Story? Portfolio Item?

    Sagi


  • 9.  RE: Batch Update

    Posted Jun 10, 2020 03:21 PM
    Hi Sagi,
    This is a multi value custom-field. This is  belongs to Portfolio Item

    Best Regards,
    Lala


  • 10.  RE: Batch Update

    Broadcom Employee
    Posted Jun 10, 2020 03:53 PM
      |   view attached
    Thanks.

    I also just tried it on a multi-valued custom field on portfolio item and it's working for me. I'm suspecting perhaps you have some special character in your text that's causing an issue. So, what I did is I took your code, edited it in notepad++ and removed any character other than space characters and newlines.
    Specifically, I made sure there aren't any tabs or other stuff that maybe is messing things up. I'm attaching a file called: Lala.txt and it includes your request clean of any of special chars. You can edit it in Notepad++ (turn on show symbols) and see that there aren't any special chars there. 

    Can you please try the file I uploaded for you?

    If still not working, then can you please let me know what tool you're using to run this? Are you using Postman?

    Thanks,
    Sagi

    Attachment(s)

    txt
    Lala.txt   368 B 1 version


  • 11.  RE: Batch Update

    Posted Jun 10, 2020 04:50 PM

    Thanks Sagi for sharing.

    We did the same. But still not working. We are running the code from Visual code.

    Is it possible to have a webex ?

    I had a support ticket with Broadcom,

    Best Regards,
    Lalatendu




  • 12.  RE: Batch Update

    Broadcom Employee
    Posted Jun 10, 2020 05:56 PM
    Hi Lala,

    What is your support case# ?   I'll follow up with the support case owner.

    Thanks,
    Sagi


  • 13.  RE: Batch Update

    Posted Jun 10, 2020 06:52 PM
    Sent as a Private mail


  • 14.  RE: Batch Update

    Broadcom Employee
    Posted Jun 10, 2020 07:17 PM
    Thanks!  I'll follow up.

    Sagi


  • 15.  RE: Batch Update
    Best Answer

    Broadcom Employee
    Posted Jun 10, 2020 11:32 PM
    Hi Lala,

    The case# you gave me is already closed, it also seems to be about other issues. Can you please open a new case for this issue, in there provide the link to this discussion, probably include a text file or just the text of this failing JSON - and I'll follow up with them.

    Thanks,
    Sagi


  • 16.  RE: Batch Update

    Broadcom Employee
    Posted Jun 12, 2020 11:03 AM
    Hi Lala,

    Did you receive my last post?   Did you open a new case?  If so, let me know your new case# and I'll follow up with Support.

    Thanks,
    Sagi