On Sep 15, 2021, at 8:47 PM, William <bacha....@gmail.com> wrote:
I tried as curl -u username:password -d '{"assignee":"assigneename"}' "https://company.com/changes/projectname~branchname~change-id/assignee"I get the error "Authentication required"
On Wednesday, September 15, 2021 at 2:36:39 PM UTC-7 Matthias Sohn wrote:On Wed, Sep 15, 2021 at 8:41 PM William <bacha....@gmail.com> wrote:HiIs there a way to sed the Assignee from commadn line?use curl to call this REST API ?
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/18c9f392-71c5-49ea-9641-b0a69bba104bn%40googlegroups.com.
On Sep 15, 2021, at 8:47 PM, William <bacha....@gmail.com> wrote:Please don’t top post, it makes discussions harder to follow.I tried as curl -u username:password -d '{"assignee":"assigneename"}' "https://company.com/changes/projectname~branchname~change-id/assignee"I get the error "Authentication required"It looks like you probably didn’t use the authenticated URL. See https://gerrit-review.googlesource.com/Documentation/rest-api.html#authenticationNasser
On Wednesday, September 15, 2021 at 8:46:50 PM UTC-7 nas...@codeaurora.org wrote:On Sep 15, 2021, at 8:47 PM, William <bacha....@gmail.com> wrote:Please don’t top post, it makes discussions harder to follow.I tried as curl -u username:password -d '{"assignee":"assigneename"}' "https://company.com/changes/projectname~branchname~change-id/assignee"I get the error "Authentication required"It looks like you probably didn’t use the authenticated URL. See https://gerrit-review.googlesource.com/Documentation/rest-api.html#authenticationNasserI added /a/ and tried as below,now I get "unauthorized" error,I am pretty sure the username and password or accuratecurl -u username:password -d '{"assignee":"assigneename"}' "https://company.com/a/changes/projectname~branchname~change-id/assignee"
On Thursday, September 16, 2021 at 7:18:38 AM UTC+2 William wrote:On Wednesday, September 15, 2021 at 8:46:50 PM UTC-7 nas...@codeaurora.org wrote:On Sep 15, 2021, at 8:47 PM, William <bacha....@gmail.com> wrote:Please don’t top post, it makes discussions harder to follow.I tried as curl -u username:password -d '{"assignee":"assigneename"}' "https://company.com/changes/projectname~branchname~change-id/assignee"I get the error "Authentication required"It looks like you probably didn’t use the authenticated URL. See https://gerrit-review.googlesource.com/Documentation/rest-api.html#authenticationNasserI added /a/ and tried as below,now I get "unauthorized" error,I am pretty sure the username and password or accuratecurl -u username:password -d '{"assignee":"assigneename"}' "https://company.com/a/changes/projectname~branchname~change-id/assignee"To set assignee you'll need to use POST.Check if the account you are curl:ing with is allowed to see the change:
curl -XGET -u username:password "https://company.com/a/changes/projectname~branchname~change-id"
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/97a26640-dfdd-48de-a719-40de52b6731bn%40googlegroups.com.
You’ll want to double check that the username and password you’re using with cURL matches Gerrit’s settings. That info will be in your settings (url might be different depending on your Gerrit version): https://company.com/settings/#HTTPCredentials
On Friday, September 17, 2021 at 12:42:43 PM UTC-7 nas...@codeaurora.org wrote:You’ll want to double check that the username and password you’re using with cURL matches Gerrit’s settings. That info will be in your settings (url might be different depending on your Gerrit version): https://company.com/settings/#HTTPCredentialsPerfect, this link ,I was using a different pasword, we are supposed to use the HTTP password generated at this link
Now ,I get the error "assignee does not identify a registered user", I am trying to assign as { "assignee": "jdoe" } and I can confirm jdoe is a registered user and am able to manually assign this from the UIWhat Gerrit is saying is that it can't find any user by the name of "assignee".
Which suggests that something is not right with your request.
Sven Selberg schrieb am Dienstag, 21. September 2021 um 09:23:46 UTC+2:On Tuesday, September 21, 2021 at 2:26:16 AM UTC+2 William wrote:On Monday, September 20, 2021 at 12:21:47 AM UTC-7 Sven Selberg wrote:Now ,I get the error "assignee does not identify a registered user", I am trying to assign as { "assignee": "jdoe" } and I can confirm jdoe is a registered user and am able to manually assign this from the UIWhat Gerrit is saying is that it can't find any user by the name of "assignee".
Which suggests that something is not right with your request.I am trying send a python put as below using https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-assignee ,any guidance on why am getting "assignee does not identify a registered user" ?import requestsfrom requests.auth import HTTPBasicAuthmydata = {"assignee": "assigneename"}response = requests.put('https://company.com/a/changes/projectname~branchname~change-id/assignee',data=mydata,auth=('username', 'password'),headers={'Content-type':'application/json'},)print (response.text)
Surely this isn't an exact copy of your code.The error message suggests that "mydata" looks like {"assignee":"assignee"}, I'd check what mydata contains before request.put is called.