iceScrum | REST API - Update story, cannot update story tags – iceScrum

iceScrum Forums Discuss on iceScrum

Viewing 2 posts - 1 through 2 (of 2 total)

  • Author
    Posts
  • #14897

    ddixson
    Participant

    Hi Icescrum users,

    I am using the community version. I am able to successfully update some of my story fields, such as name, however, I can’t seem to get the tags to update. I can’t update them to remove a tag or add a tag.

    I use a json object for input, with Content-Type: text/json header
    I also tried using xml, but I get the same.

    Works:
    ===
    For example, when I PUT with the json object:

    {
        "story":{
            "name": "This is a BOGUS name"
        }
    }

    I receive a 200 response and the name is updated.

    Doesn’t work
    ===

    {
        "story":{
            "tags": "bogus_tag1, bogus_tag2, bogus_tag3"
        }
    }

    Per the API docs – https://www.icescrum.com/documentation/story-api/#story-api_4
    I should be able to update the tags. I receive a 200 response, but the tags aren’t updated.

    Looking at the GET response, I also tried

    {
        "story":{
            "tags": ["bogus_tag1", "bogus_tag2", "bogus_tag3"]
        }
    }

    I also receive a 200 response, but the tags don’t update

    Any words of wisdom? My main use case is to delete an existing tag on a bunch of my stories then add back a new tag.

    #14915

    Nicolas Noullet
    Keymaster

    Hi,

    An additional parameter that was not mentioned in the documentation is required! The documentation has now been updated accordingly. This parameter is called “manageTags” and it indicates whether tags should be updated.

    Here is an example payload:

    {
        "manageTags": "true",
        "story": {
            "tags": ["bogus_tag1", "bogus_tag2", "bogus_tag3"]
        }
    }

    You can alternatively use the string / coma based syntax for (which should not contain whitespaces) but it is mainly there to work with XML. JSON arrays are supported so you can use them.

    Here is an example of a working cURL command:
    curl -u yourUser:yourPassword -X PUT -H "Content-Type: application/json" -d '{"manageTags": "true", "story": {"tags": ["foo","bar"]}}' http://yourServer/ws/p/YOURPROJ/story/152

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Questions and help’ is closed to new topics and replies.