Changing Importance via API
I cannot seem to modify ticket importance via the API. I'm using the lighthouse-api 2.0 rubygem.
Here's an example:
1.9.3p392 :021 > t = Lighthouse::Ticket.find 652, params: { project_id: 52600 }
=> #<Lighthouse::Ticket:0x007f9dbd4ff468 ...
1.9.3p392 :022 > t.importance
=> 2
1.9.3p392 :023 > t.importance = 1
=> 1
1.9.3p392 :024 > t.save!
=> true
1.9.3p392 :025 > t = Lighthouse::Ticket.find 652, params: { project_id: 52600 }
=> #<Lighthouse::Ticket:0x007f9dc180e100 ...
1.9.3p392 :026 > t.importance
=> 2
Discussions are closed to public comments.
If you need help with Lighthouse please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Nicole on 23 May, 2013 07:45 PM
John -
Are you using https://github.com/entp/lighthouse-api? If not, the other isn't maintained by us and doesn't look like it's been updated since 2010. Let us know and we'll continue troubleshooting with you.
Thanks,
Nicole
2 Posted by John Wulff on 23 May, 2013 08:13 PM
https://github.com/entp/lighthouse-api and http://rubygems.org/gems/lighthouse-api being two different things is very confusing. It looks like the difference between the original repo and the one your maintaining isn't significant. https://github.com/entp/lighthouse-api/compare/Caged:master...master
Anyway, I've switched to
git://github.com/entp/lighthouse-api.git
instead of what RubyGems thinkslighthouse-api
is and I'm getting the exact same behavior as demonstrated in the console paste in my first message.I've also tried using curl and minimal XML to isolate the problem. Here's what I tried (I've omitted irrelevant portions of the XML responses):
This shows that the importance change is indeed not being applied.
Thanks for your help, really appreciate it!
3 Posted by John Wulff on 23 May, 2013 08:37 PM
I've just noticed in your API documentation (http://help.lighthouseapp.com/kb/api/tickets) it says you only support the following fields for ticket POST (creation).
Do you only support these fields for PUT (update) as well? That may explain why importance changes are not taking.
I know we used to be able to set
priority
but I think whenpriority
was renamed toimportance
we lost the ability to setimportance
via the API.4 Posted by Julien on 23 May, 2013 09:11 PM
Hi John,
There is a significant difference between Caged and entp:
That sets the content type to XML. The Caged version will send XML but it will be interpreted as text, and so won't work.
Regarding the
importance
field, if you are using the gem, you can usepriority
instead: it will set the importance. If you are using curl, usingimportance
directly will work. Your example failed because you didn't send a content type of XML.Let me know how it goes with these changes.
5 Posted by John Wulff on 23 May, 2013 09:13 PM
Well! It looks like reverting back to priority for PUT and POST purposes has fixed things. We still need to use the new importance field for properly "reading"
Thanks Julien!
Julien closed this discussion on 23 May, 2013 09:32 PM.