Possible to vote with api?

It it possible to vote for issues with the api?

Watching (star) works
issue/{issue}/execute?command=star user

But not voting (vote?)
issue/{issue}/execute?command=vote user
4 comments
Comment actions Permalink
Hello, Anders!
Unfortunately, REST API doesn't support vote method now.
Here is issues, I' ve created: http://youtrack.jetbrains.com/issue/JT-17152
You can vote for the issue to get it resolved faster.

But there is workaround for your case:
1. Create workflow, like:
rule vote 
 when comments.added.isNotEmpty { 
  if (comments.added.first.text.contains("vote +1", opts)) { 
    loggedInUser.voteIssue(issue); 
  } 
}
prettyPrint();
2. Attach WF to your project
3. Then you can make POST request, like:
/rest/issue/{issue}/execute?comment=vote +1
And you will be able to vote for the issues with the REST API.

--
Regards, Mikhail
0
Comment actions Permalink
Thanks,

this is definitely a good workaround. And I voted for the issue, of course :)

Minor issue, is it possible to delete (cancel?) the "vote"-comment?
0
Comment actions Permalink
There is REST method for deleting comment:
DELETE rest/issue_id/comment/comment_id
prettyPrint();
Also will be helpful method for getting issue by issue ID:
GET /rest/issue/issue_id
prettyPrint();
So you can get list of user, who have voted for issue and comments with their id.


--
Regards, Mikhail
0
Comment actions Permalink
Thank you,

I can now sucessfully vote for issues with the api.
0

Please sign in to leave a comment.