Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Create a pull request as a particular user

Carl Myers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 2, 2015

For integration purposes, I need to create a pull request as a specific user, from a service account.  There Doesn't seem to be any efforts underway to implement this, the only reference I can find to it is in a comment on this issue (which seems to misunderstand what the original submitter is asking for): https://jira.atlassian.com/browse/STASH-4185

 

After carefully looking at all the non-internal (and internal too) APIs available to plugins, I can't see how to change a PR's owner after the fact.  I had the idea to try making an "api proxy" that would let you "sudo" to some other user then execute a rest call, but I'm not sure how to do that either.

Given that you can run code as some other user using SecurityService.impersonating(...).call(...), is there a way for a plugin to impersonate another user, get a session cookie or oauth token of some sort, then make rest calls on their behalf?  Or is there a way better way to do this?  Right now our tool makes rest calls so if we could just point it at the "sudo proxy" without changing anything else that'd be a big win.

 

Thanks!
-Carl 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Carl Myers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 3, 2015
Herman Griffin November 30, 2018

Hello Carl,

Did you find/create a solution for this issue?

Cheers,

Herman

TAGS
AUG Leaders

Atlassian Community Events