Adding comments using API

254 views
Skip to first unread message

olivier....@gmail.com

unread,
Feb 19, 2016, 4:49:39 PM2/19/16
to taigaio
Hi.

I'm wondering if i'm missing something in the API documentation but i cannot figure how to add a comment into an issue using the API.
I have created a small frontend to integrate in our application to allow users to send us issues/feedback and so on.

I would like to be able to add comments from our application but i can't seem to find a way...

Is there one?

Thanks

David Barragán

unread,
Feb 20, 2016, 5:08:00 AM2/20/16
to olivier....@gmail.com, taigaio
Make a PATCH over the issue with a "comment".

Regards.

--
Please help us keep the Taiga.io Community open and inclusive, follow our Code of Conduct:
https://github.com/taigaio/code-of-conduct/blob/master/CODE_OF_CONDUCT.md
---
You received this message because you are subscribed to the Google Groups "taigaio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to taigaio+u...@googlegroups.com.
To post to this group, send email to tai...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/taigaio/b2c43b33-4599-4c11-8ec4-496dcee1fc45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

---

 
David Barragán Merino  
Engineer

www.kaleidos.net/FFF8E7

olivier....@gmail.com

unread,
Feb 20, 2016, 5:51:56 AM2/20/16
to taigaio, olivier....@gmail.com
Thanks David.

I'm going to try that and revert back.

David Barragán

unread,
Feb 20, 2016, 6:04:14 AM2/20/16
to olivier....@gmail.com, taigaio
You are wlcome


For more options, visit https://groups.google.com/d/optout.

olivier....@gmail.com

unread,
Feb 20, 2016, 10:07:08 AM2/20/16
to taigaio, olivier....@gmail.com
Hi David.

I have managed to add a comment using the PATCH method and sending the comment.

First, the documentation doesn't mention about the version but i was getting a 400 ('{"version": "The version parameter is not valid"}').
I added the version and got a successful 200 status.

But for some reason, the comment is added twice in my issues...
No idea why...

I'm using requests and this command:

requests.patch('https://api.taiga.io/api/v1/issues/215894', data=json.dumps({'comment': 'The comment is added again?'}), headers=self.header)


Any idea?


Thanks

olivier....@gmail.com

unread,
Feb 20, 2016, 10:29:16 AM2/20/16
to taigaio, olivier....@gmail.com
just a quick clarification.
I have found the section in the documentation mentioning the version (http://taigaio.github.io/taiga-doc/dist/api.html#_occ_optimistic_concurrency_control)
My bad sorry.

Also, the request i pasted earlier doesn't include the version but it is included in my tests...
requests.patch('https://api.taiga.io/api/v1/issues/215894', data=json.dumps({'comment''The comment is added again?', 'version': 4}), headers=self.header)

Thanks

David Barragán

unread,
Feb 20, 2016, 11:22:20 AM2/20/16
to Olivier Florentin, taigaio

olivier....@gmail.com

unread,
Feb 20, 2016, 12:54:08 PM2/20/16
to taigaio, olivier....@gmail.com
Thanks for the links.
I didn't know it.
I did not look for any django app as the original idea was only to list the issues for a particular project.
Just a few requirements were added while showing the prototype.

I think at this stage, i'm almost complete so i will probably not go that route but i will for sure go through the code... may be on the next project??

In the mean time, i fixed my issue.
in all fairness, it had nothing to do with taiga API (but you knew, didn't you ? :-) ).
I was using some expression evaluator in my IDE and for some reason, it was sending the request twice.
Calling the function within the code works as expected.

Sorry my the messing around and thanks for your help.
Reply all
Reply to author
Forward
0 new messages