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.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.