Unable to delete all labels by API
Attempting to delete all the labels via the API by passing in an empty element in the body does not work, neither does passing in an empty element with <labels></labels>. Is it possible to delete all labels? If so, how?
Here is the curl request and response. Thanks!
curl -H "X-TrackerToken: TOKEN"
-H "Content-type: application/xml"
-d "<story><labels></labels></story>"
-X PUT http://www.pivotaltracker.com/service...
<?xml version="1.0" encoding="UTF-8"?>
<story>
<id type="integer">1494868</id>
<story_type>feature</story_type>
<url>http://www.pivotaltracker.com/story/s...</url>
<estimate type="integer">-1</estimate>
<current_state>unstarted</current_state>
<description></description>
<name>Get out of bed</name>
<requested_by>Lowell Kirsh</requested_by>
<created_at type="datetime">2009/10/15 17:10:22 UTC</created_at>
<labels>foo</labels>
</story>
Here is the curl request and response. Thanks!
curl -H "X-TrackerToken: TOKEN"
-H "Content-type: application/xml"
-d "<story><labels></labels></story>"
-X PUT http://www.pivotaltracker.com/service...
<?xml version="1.0" encoding="UTF-8"?>
<story>
<id type="integer">1494868</id>
<story_type>feature</story_type>
<url>http://www.pivotaltracker.com/story/s...</url>
<estimate type="integer">-1</estimate>
<current_state>unstarted</current_state>
<description></description>
<name>Get out of bed</name>
<requested_by>Lowell Kirsh</requested_by>
<created_at type="datetime">2009/10/15 17:10:22 UTC</created_at>
<labels>foo</labels>
</story>
1
person has this problem
I have this problem, too!
Tell me when someone solves it.
The more people who report this problem, the more it gets noticed.
The more people who report this problem, the more it gets noticed.
The company marked this problem solved.
-
Inappropriate?Empty or missing XML elements are ignored, but you can remove all the story's labels via CGI parameters. See the example below.
curl -H "X-TrackerToken: TOKEN" -X PUT "http://www.pivotaltracker.com/services/v2/projects/PROJECT_ID/stories/STORY_ID?story\[labels\]=" -
Inappropriate?I haven't seen this documented anywhere. Is it?
-
Inappropriate?Its not but we will get it documented. We didn't try removing labels via XML until you reported a problem.
-
Inappropriate?Thanks for your help Mark. One last question: do you know offhand if ActiveResource (on our side of the wire) has direct support for generating the url you suggest we hit to do the deletion?
-
Inappropriate?OK, problem solved. Here is our code (BTW, we have a Story class on which we are trying to delete its labels):
class Story < ActiveResource::Base
...
def update
if labels.blank?
self.prefix_options['story[labels]'] = nil
end
super
end
Loading Profile...


