Hi,
I'm using the cloud versions of JIRA Service desk and Software and want to use the current user as reporter for clone which I'm creating with Scriptrunner. How do I get the current logged in user. It should be so easy, but I googled around and cannot come up with an answer.
Thanks
Rudy
Hi Rudy,
In the additionalCode of the Clone Issue post function you'll need this code:
def response = get('/rest/api/2/myself').asObject(Map) assert response.status == 200 def currentUsername = response.body.name issueInput.fields.reporter = [name: currentUsername] as Map
Here's a screenshot too:
clone_issue.png
I hope that helps, Jon
Thanks @Jon Bevan [Adaptavist], that is not what I expected, but sure works! It is quite a change going from scriptrunner server to cloud!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.